Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange access denied message

Status
Not open for further replies.

abenstex

Programmer
Jan 9, 2005
47
DE
Hello!

Maybe i am going completely insane or i just can't see an error, but everytime i try to log in to a database i get an error message like this:
Access denied for user: 'root@%' to database 'myDB'. What confuses me about it is the "%". All the data concerning the server, the password are correct but i get this strange message.
 
The '%' means "any machine". Each record in the privilege tables contains a user name (or blank for any user), and a host machine name/address (which can contain '%' wildcards, like in an SQL LIKE expression).

Your privilege tables might specify different credentials depending on which machine you connect from. For example, MySQL's default user table contains two records for root; one connecting from localhost, and another for connecting from other machines.

If you succeed in connecting, have a look at your user table ("SELECT * FROM mysql.user"), and you will see what records are there.
 
What client are you using? If this is a call from say php, then you may need to qualify the server as localhost. Is this a new install? Have you set the root password?
You may need to log in to the mysql console locally to configure it first.

Mark
 
The client i am using to try to access MySQL is a Java Servlet, but actually i qualified the server as localhost. And the root password is set and correct because i can log in via command line without problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top