Link to home
Start Free TrialLog in
Avatar of monitorwa
monitorwa

asked on

mysql Access denied for user 'username' '@'%' to database databasename

Hi,
I am getting the following error when my application tries to connect to the Mysql database.
mysql Access denied for user 'username' '@'%' to database databasename

The application uses and ODBC connection for its connection - funny enough the test connection works fine through the ODBC connection test but when the application tries to connect it gets the error shown above.
One of the other instances of this application initially had an error that said to flush-hosts which I have done and that instance now connects fine however the other instance wont connect? I have tried the flush hosts again, created a new user with full access tot he tables and database.
Any suggestions?
Avatar of johanntagle
johanntagle
Flag of Philippines image

mysql Access denied for user 'username' '@'%' to database databasename

Are there really two quote characters after the username above?  Because if the same account from the same host connects fine using ODBC then what needs to be checked is the application, and if the application tries to connect with an extra single quote character, it may be the source of the error.
Avatar of monitorwa
monitorwa

ASKER

Hi johan,
The same application is connecting using the same user from several other pc's, in fact until yesterday this PC also connected fine without any error?
Its as if the server has somehow blocked this PC from having access, I have tried the flush-hosts for user root but it hasnt helped? I wonder if I need to try the flush-hosts for this specific user even though I have actually created and changed the ODBC connection to this new user?
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Johan,
The user isnt the sharpest tool in the shed so Im pretty limited on what they can test but the application uses an ODBC connection but fails when run as per the details above, if I have the user go to the ODBC connection and run a test on the connection it connects fine, the user doesnt have any other MYSQL tools installed so I can get them to try connecting any other way.
I have set the privileges to grant access to everything but it still fails - funny thing is that the same user is fine from the other installations of this application so I think that shows the actual user privileges are fine. Any other suggestions?

thanks

Dave
Hi Johan,
thanks for your help and suggestions - it turns out that someone must have fiddled over the weekend and the ODBC connection name had been change to have a space in front, bit of a weird error message but all sorted now so thanks again for your help
dave