This forum is no longer active. Please post your questions to our new community site

Forums WAMPStack

access denied for user 'ODBC'

Subscribe to access denied for user 'ODBC' 2 post(s), 2 voice(s)

 
Avatar versus 1 post

Installed the wampstack on my new laptop this morning, and everything seems to be working more or less. Imported php scripts and databases from my desktop pc (where they work fine), and hit my
first roadblock:

Running a php script that queries the database, I get error message:
Access denied for user ’ODBC’@’localhost’ (using password: NO)

The relevent php code is:
$conn = mysql_connect(“localhost”, "", "") or die(mysql_error());

Have changed the code to: (“localhost”, “ODBC”, "")
also to: (“localhost”, “root”, "")
and a few other things but have not accidented onto the correct syntax.

It seems like it should be a simple fix, and maybe after sleep it will be. For now, was wondering if anyone has had this problem or knows what to do about it?

Thanks

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

It seems that the database ODBC does not exist or does not have permissions for the user. If you want to connect to the database as root you should specify the password:

mysql_connect(‘localhost’, ‘root’, ‘mysql_password’);

The root password is the same that you configured during the installation.

Cheers.

Forums WAMPStack