Solved

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

Posted on 2012-04-01
5
334 Views
Last Modified: 2012-04-01
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?
0
Comment
Question by:monitorwa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 24

Expert Comment

by:johanntagle
ID: 37794619
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.
0
 

Author Comment

by:monitorwa
ID: 37794633
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?
0
 
LVL 24

Accepted Solution

by:
johanntagle earned 500 total points
ID: 37794638
Okay so you are saying even basic connection tests from that host fail, not just from the application?  Using a mysql admin/root account can you do a "show grants for username" to see if correct privileges are configured?
0
 

Author Comment

by:monitorwa
ID: 37794651
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
0
 

Author Closing Comment

by:monitorwa
ID: 37794677
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
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question