Code:
$link=mysql_connect("localhost", "root", "") or die("Error connecting");
Should work, you'sure you havn't assigned a password for root?, and that you can connect to the mysql-db with: mysql -u root -p ? With no password given at the prompt.
This is why the error your talking about happens:
Redhead@smaug{103} ~> mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
Redhead@smaug{105} ~> mysql -u root -p
Enter password: <my secret password>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 251 to server version: 3.23.37
Type 'help;' or '\h' for help. Type '\c' to clear the buffer
mysql>
Seems like your mysql-db want's a password for root, but you leave it blank.
Bookmarks