I wanted to test a script written for PHP 5.3.5 (installed as an Apache module) in a PHP 5.2 environment.
I installed a new copy of Apache 2.0.64 and PHP 5.2.17 and configured it EXACTLY, as I was setting up PHP 5.3 before. In addition, I copied libmysql.dll to the Apache bin directory (PHP 5.3 no longer has this file).
Both servers are manually configured (and not XAMPP versions or something else) and gain access to the same locally installed mySQL Server 5.5.8. Both servers are running Windows Server under a system account.
PHP 5.3 works fine, PHP 5.2 returns an error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\Tools\htdocs\myscript.php on line 33
The SQL user I'm using is hard-coded in the ant PHP code, this is not SYSTEM@localhost . The system seems to be the Windows account that Apache runs on. (If I started Apache from the administrator account, the message will change to Administrator@localhost .)
The default user (with the name ``) was deleted on my SQL server. If this empty user exists, PHP 5.2 successfully connects to the database, but the selection of the database ( mysql_select_db ) mysql_select_db due to permissions.
source share