Hopefully this has an obvious answer - sorry if this is a stupid noob question. I read through as many threads as possible on the forum before posting this.
I have a user that I have added to my database in cPanel (yup, definitely added, not just created, all privileges were granted as well just to be sure). I have reset the password a couple of times to make sure the password was correct.
My php script tries to connect to the database but gets the access denied error. My script prints out the error:
Could not connect: Access denied for user 'dash34_test'@'localhost' (using password: YES)
This database was created in cPanel. The database schema was imported from a .sql file through phpmyAdmin from the mySQL instance on my home computer - the mySQL version on my computer is 5.5.27. I checked the .sql file and there is NO MENTION of the database name anywhere except in a comment at the top of the file. The import process just creates tables - it doesn't affect the database name or users at all.
Here is the script I am using to connect:
$db = mysql_connect("localhost","dash34_test","xxxxxxxx"); // note that I have overtyped the real password with xxxxxxxx
if (!$db)
{
die('Could not connect: ' . mysql_error());
}
So, there is a database to connect to, the user exists for this database and has the correct password. The script has the correct user name and password.
What should I try next?
thanks in advance for any help.
I have a user that I have added to my database in cPanel (yup, definitely added, not just created, all privileges were granted as well just to be sure). I have reset the password a couple of times to make sure the password was correct.
My php script tries to connect to the database but gets the access denied error. My script prints out the error:
Could not connect: Access denied for user 'dash34_test'@'localhost' (using password: YES)
This database was created in cPanel. The database schema was imported from a .sql file through phpmyAdmin from the mySQL instance on my home computer - the mySQL version on my computer is 5.5.27. I checked the .sql file and there is NO MENTION of the database name anywhere except in a comment at the top of the file. The import process just creates tables - it doesn't affect the database name or users at all.
Here is the script I am using to connect:
$db = mysql_connect("localhost","dash34_test","xxxxxxxx"); // note that I have overtyped the real password with xxxxxxxx
if (!$db)
{
die('Could not connect: ' . mysql_error());
}
So, there is a database to connect to, the user exists for this database and has the correct password. The script has the correct user name and password.
What should I try next?
thanks in advance for any help.
Last edited: