It seems to me that you didn't create a password for the root user.
If you don't know how to do that, here's a reference:
Code:
At the console window type the following commands (replace new_password with your new password):
Enter: cd c:\mysql\bin
Enter: mysql −u root mysql
Response: Welcome to the MySQL monitor .....
Enter: UPDATE user SET Password=PASSWORD('new_password')
Enter: WHERE user='root';
Response: OK...
Enter: FLUSH PRIVILEGES;
Response: OK...
Enter: DELETE FROM user WHERE user='';
Response: OK...
Enter: DELETE FROM user WHERE Host='%';
Response: OK...
Enter: DELETE FROM user WHERE User='';
Response: OK...
Enter: DELETE FROM db WHERE Host='%';
Response: OK...
Enter: exit
Response: Bye
Enter: exit
Response: Console window closes.
Then, if you want to use the root user, you do the following:
PHP Code:
$dbcnx = @mysql_connect('localhost', 'root', 'your_password');
Bookmarks