Just got a new server. Created a db, created an user with permissions for this DB (using webmin).
My script:
define('C_HOST','localhost');
define('C_USER','dbuser');
define('C_PASS','mypassword');
define('C_BASE','mydb');
@mysql_connect(C_HOST, C_USER, C_PASS) or die(mysql_error());
Output:
Access denied for user 'root'@'localhost' (using password: NO)
Why my script is trying to connect as root if C_USER is "dbuser". Even if I change C_USER to "root" and C_PASS to MySQL root password I get the same error:
Access denied for user 'root'@'localhost' (using password: NO)
PHP Version: 5.1.4
MySQL version: 5.0.22