I have PHP, MySQL installed on my Windows Vista machine and have been breaking my skull over the following error from mysql_connect().
Error: Access denied for user ''@'localhost' (using password: NO)
I can tell you the problem was not the Server, User or Password in my code. However there was a problem with PHP and its passing of connection information to the MySQL server. There are a few problems that I encountered. The suspect words in the error ware " password: NO". I knew I was passing a password so this hinted that the server was getting blank connection variables in the connection string.
1) Variables containing connection information between php files and classes -> Solved by using for example: $GLOBALS['dbserver'] to make sure no blank variables are been passed.
2) In the PHP.ini file there is a section for MySQL which has some space to set default server etc. Seems that PHP was using these setting despite me setting them in the code.