PHP can't connect to MySQL
Posted: 15. December 2012 05:03
I've been running older versions of XAMPP for years, and thought I'd start the update process by trying out 1.8.1 Portable version.
I've used the installer [xampp-portable-win32-1.8.1-VC9-installer.exe] to put it into \XAMPP on a removable drive, no problems, XAMPP status page is ok etc.
Now I've copied some existing websites and databases (including mysql db) onto same removable drive as XAMPP, into \WWW and \Databases respectively (this is my standard server setup pattern) and edited my.ini, php.,ini, vhosts.conf etc minimally to get everything working.
I manually start mysql and apache using the scripts in \XAMPP, and both fire up ok. I can talk to mysql ok using the command line - root login is fine, I can see my databases, no problems. Apache is also running fine - I can access any of my websites.
However, the sites (built in PHP) can't talk to mysql - connection is refused. I have a couple of different phpMyAdmin versions installed; running either of those (2.11.11 and 3.5.3) throws the same error - #2054 - The server requested authentication method umknown to the client . Both phpMyAdmins are set to auth=config, using root credentials; as I said, I can login ok as root on the mysql command line, so am scratching my head to see where the problem can be for PHP, unless I've missed a crucial setting somewhere, or a default has changed that I'm not aware of.
Just to check, I've tried this on two different systems (one WIndows XP, one Server 2003) and results are identical.
I'd be grateful if anyone can suggest what the problem might be!
I've used the installer [xampp-portable-win32-1.8.1-VC9-installer.exe] to put it into \XAMPP on a removable drive, no problems, XAMPP status page is ok etc.
Now I've copied some existing websites and databases (including mysql db) onto same removable drive as XAMPP, into \WWW and \Databases respectively (this is my standard server setup pattern) and edited my.ini, php.,ini, vhosts.conf etc minimally to get everything working.
I manually start mysql and apache using the scripts in \XAMPP, and both fire up ok. I can talk to mysql ok using the command line - root login is fine, I can see my databases, no problems. Apache is also running fine - I can access any of my websites.
However, the sites (built in PHP) can't talk to mysql - connection is refused. I have a couple of different phpMyAdmin versions installed; running either of those (2.11.11 and 3.5.3) throws the same error - #2054 - The server requested authentication method umknown to the client . Both phpMyAdmins are set to auth=config, using root credentials; as I said, I can login ok as root on the mysql command line, so am scratching my head to see where the problem can be for PHP, unless I've missed a crucial setting somewhere, or a default has changed that I'm not aware of.
Just to check, I've tried this on two different systems (one WIndows XP, one Server 2003) and results are identical.
I'd be grateful if anyone can suggest what the problem might be!