With this code:
<?php
$link = mysql_connect ("localhost", "username", "password")
or die ("Could not connect");
print ("Connected successfully");
mysql_close ($link);
?>
I get this error:
Warning: MySQL Connection Failed: Access denied for user: 'username@localhost' (Using password: YES) in /home/httpd/html/index.php3 on line 2
Could not connect
The database and the php script both runs on "localhost".
The username and password for the mysql database is valid since i can connect to the database with this user manually.