I installed mysql and apache. Apache is serving wordpress correctly and I want to install wordpress via install.php. This fails at setup step 2 after inserting database name, user and password (error 500).
I suspect that I haven't correctly finished the mysql database setup.
So to check, I log in to mysql via mysql -u root -p and run select database(); which returns null. So there is no database. Then when I call create database wordpress it says the db already exists. So what??
Just in case someone asks why not use xampp or wamp or the like: I want to set up everything by hand to learn the basics.
System setup: Windows 8.1 64 bit, mysql 5.7.21, apache 2.4, php 7.2.4 w/ thread safe
In the php.ini file you have to enable two settings:
extension = mysqli
extension_dir = "ext"
The root cause was that I had only activated the extension setting.
The website where I found this tip did not mention the requirement to also set the extension directory.
The final solution is from the official guide to install mysqli, which is very misleading in this regard:
For PHP > 5.3 it says
On Windows, for PHP versions 5.3 and newer, the mysqli extension is
enabled and uses the MySQL Native Driver by default. This means you
don't need to worry about configuring access to libmysql.dll.
But this was not true for me. It did not work out of the box.
For older versions (e.g. ones which should not affect my version) it says
As with enabling any PHP extension (such as php_mysqli.dll), the PHP
directive extension_dir should be set to the directory where the PHP
extensions are located. See also the Manual Windows Installation
Instructions. An example extension_dir value for PHP 5 is c:\php\ext.
This was the final hint that got it working.
Related
enter image description hereI'm try to install hmailserver in combination with wamp/mysql.
I get an errormessage, hmailserver recommends to copy a file manually.
copypaste:
Error:
The MySQL client (libmysql.dll, 32 bit) could not be loaded.
hMailServer needs this file to be able to connect to MySQL.
The MySQL client needs to be manually copied to the hMailServer Bin directory. The file is not included in the hMailServer installation.
Path: H:\Program Files (x86)\hMailServer\Bin\libmysql.dll.
I don't see MySql in the service (Step 5 in the "HmailServer Database Step up -Step 5 of 7). And wampapache doesn't work either.
Thank you for the help.
enter image description here
I figured it out. I go into "C:\wamp\bin\mysql\mysql5.7.14\lib" right click "libmysql.dll" next press copy. I go to "C:\Program Files (x86)\hMailServer\Bin" and paste the copied file into it
The MYSQL Server service is called wampmysqld or if you have the 64bit WAMPServer wampmysqld64
However I would suggest that you take the other option and use the SQLServer database with hmailserver.
If you use MySQL which I admit seems like the most obvious option, then every time you ADDON another MySQLServer version to WAMPServer you will have to migrate the hmailserver database over to the new MySQL, and like me forget to do so.
If you use the built in SQLServer database with hmailserver, you can basically forget about hmailserver whenever you change something in WAMPServer's MySQLServer versions.
Regarding hMailServer and MySQL 8.x
It doesn't matter if you run a 32-Bit or 64-Bit MySQL Server on the same Windows
Machine or on a Remote server (regardless which OS) as long as you have the required libmysql.dll file in hMailServer /bin folder or a at your PATH Environment variable.
Regarding MySQL 8.x:
MySQL 8.x enables per default its new API API which is incompatible with
all hMailServer versions. You need to configure MySQL 8.x in mixed mode which allows
5.7.x MySQL Clients to connect to make it work with hMailServer. You also can use
a MySQL 5.7.x Release without any configuration to make it work out of the box.
For more info see: https://www.hmailserver.com/forum/viewtopic.php?f=10&t=33819
I just grabbed the latest version of MAMP Pro (3.1) and installed it only to find that it removes MySQL PDO entirely. That's a problem since the framework I'm using requires PDO to connect to the database. I tried grabbing the extensions from the old version of MAMP, but it immediately throws errors.
How do I get MySQL PDO back for MAMP 3.1? I've looked on the site and can't find a downloads page to roll back to the older version.
In MAMP 3.1, they've made the switch to mysqlnd which actually includes mysql, mysqli, and PDO. The problem is that they've removed all the PDO settings in php.ini because they aren't using the MySQL PDO extension. Because of this change, from the command line, PHP is looking at the wrong MySQL socket file. To fix this, I updated the php.ini file with the following line:
pdo_mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock
After that, everything started working again.
If anyone from Appsolute sees this, PLEASE re-add the PDO settings to the INI files so this sort of thing doesn't happen!
I have a problem where I am trying to connect to old database with new php5 and getting
mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password').
Everyone appears to solve this problem through making changes to either database config file or rehashing their passwords.
Catch is, I cannot do either at the moment. I would like to know if there is a way to make php5 use old passwords.
Given your constraint, your only option is to recompile PHP against the libmysqlclient library (instead of the default, native PHP mysqlnd). Try the "Linux-Generic" "Development Libraries" binaries provided by MySQL.
You might need to use an older version of libmysqlclient, I am not sure the newer versions still support the old authentication method.
I'm developing an installer for my program for Windows OS.
I'd like the installer to check if MySQL is already installed and if it isn't silently install MySQL before installation is over.
How can I check if MySQL is already on the computer with delphi?
Regarding MySQL server:
As #Shirish11 sayd, you can check HKLM\SOFTWARE\MySQL AB. But that does not guarantee anything, as this registry key is optional. MySQL really does not require any "complex" installation procedure, like SQL Server. You can download MySQL as an installer, as just a ZIP archive. In last case the registry key will be not created. The similar with services. Using mysqld.exe --install Kitty --defaults-file=c:\mysql.cfg command line you can create MySQL service with Kitty name. Or even a service may be not created at all.
The MySQL server may be installed not locally, but on a different host. And be administrated by a dedicated DBA. So, you may not need to check / install server at all. Just not your task. If your application is going to install a local server, which will be used only by "this" workstation, then use MySQL Embedded.
In general, you should ask the user about MySQL installation, eg "Do you have MySQL server installed ?". And if user answers "yes", then you can ask him for login parameters (host, port, database, user name, password). If not, then you can suggest him to download it and install, to avoid licensing issues. Because you have to have a license, purchased from Oracle, to distribute the MySQL Server installer with your software.
Regarding MySQL client:
There is no other signs, that libmysql.dll is "installed", than the libmysql.dll presence. You can check for libmysql.dll at Windows folder, at PATH folders. More simple - you can always put it with your EXE.
If you are using dbExpress, then you should use specific libmysql.dll version, supported by EMBT dbExpress driver. So, again, better to put it with your EXE.
See note (3) regarding server licensing. It applies to client too.
Check for this registry entry for MySQL if present
HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB
If you have MySQL installed then this entry should be present.
If you need some thing more, then check for the service if its present
function ServiceIsPresent(sMachine, sService: PChar): Boolean;
var
SCManHandle, SvcHandle: SC_Handle;
begin
// Open service manager handle.
SCManHandle := OpenSCManager(sMachine, nil, SC_MANAGER_CONNECT);
if (SCManHandle > 0) then
begin
SvcHandle := OpenService(SCManHandle, sService, SERVICE_QUERY_STATUS);
// if Service installed
if (SvcHandle > 0) then
begin
Result := True;
CloseServiceHandle(SvcHandle);
end;
else
Result := False;
CloseServiceHandle(SCManHandle);
end;
end;
function call
ServiceGetStatus(nil,'MySQL');
I have picked up this service name from my registry entries
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
But be careful while using service check because some people might have different service names for MySQL service.
As in my case I have 2 installations of MySQL hence 2 services are present MySQL,MySQL501.
Hence it will be bit tedious to find out the correct service name.
Mind you HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB can remain in registry even on uninstall of MySQL. What gets removed is HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\MySQL Server 5.1 but since we do not know the MySQL Server 5.1 part in advance, its not easy to go for this approach. Moreover MySQL need not be installed as such.
What is possible is to check HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MySQL\ImagePath and then see if the path specified by the value exists. The second part is important because MySQL need not remove the service key during uninstallation if service is already turned off. So this registry value can remain even after uninstallation. So the best option is to get the path of the executable from the above mentioned registry and then see if the mysqld.exe or (whatever it is) exists. MySQL is not installed if either the registry value doesn't exist or if the file doesnt exist. The catch here is that this logic fails if MySQL is installed but not configured to start its service (which means there is no key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MySQL). But thats trivial, since running MySQL installations will anyway have it and most machines will have MySQL running. Now even if the installed MySQL is not configured to have a service, its quite okay to install another version of your MySQL and register your service first.
I'm unsure of a perfect solution, the reason being MySQL being not a proprietary software. I mean anyone can bundle MySQL and install in their own flavours. For example, wampserver comes with their own MySQL. Client machines most certainly wont have servers installed that way, but we can not rule out the option and we may not want another MySQL instance (Note that a separate instance of MySQL runs fine along with MySQL in wamp server). What I do is check the above, if I did not find, I check for the image path of wamp service, like HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\wampmysqld\ImagePath. It depends on the server you have on a machine.
All,
For all of this I am using Mac OSX Snow Leopard.
I have happily used XAMPP to develop PHP backed sites in the past with no problems(as you'd expect for such a simple to set up package). I am now trying to set up this MySQL install in Netbeans 6.8 (for now just trying to get a sample database backed webapp to run). My issue is that even though MySQL has been started I cannot connect to it at 127.0.0.1 on port 3306 (which it is set up to use).
I have read that the issue is that XAMPP holds MySQl.sock in /Applications/XAMPP/xamppfiles/... whereas MySQL Workbench and Netbeans expects to find it in /tmp/MySQL.sock. Is this correct? I've tried to set up a symbolic link from /tmp to the xmapp directory but this doesn't appear to have changed anything.
Is there anything else I can try/anything that I am missing?
I upgraded from an older version of XAMPP to 1.7.3 and encountered a the same problem, I got MySQL Workbench to connect if I edited the my.ini file and:
changed the socket parameter to:
socket = "TCP/IP"
made mysql bind to an IP address or all IP as in the case below:
enable-named-pipe
bind-address=0.0.0.0
This requires that you disable named-pipe (as shown above)
I could not get this to work. So in case anyone else is reading this and wondering what happened... I installed a non XAMPP instance of the MySQL database and am using that now instead. Less than ideal but it works.