Techy: MySQL Error 1045 (28000): Access denied – but the login details are correct

January 1st, 2013 by Richy B. Leave a reply »

I’ve just copied over my MySQL databases to a new location on my Linux Mint 14 (Ubuntu based) machine and whenever I tried to login as a non-root user (either via the command line or via PHP), I received an error like:

ERROR 1045 (28000): Access denied for user 'currentusername'@'localhost' (using password: YES)

I tried resetting the password, deleting that user, re-creating it – all without success.

Then I noticed, in phpMyAdmin, there were three “Any” users. Deleting them allowed the other logins to work correctly.

So – if you get the “Error 1045 Access denied” message from MySQL and you are pretty sure the details are correct, check your database for the “Any” user (also check the MySQL list at http://dev.mysql.com/doc/refman/5.1/en/access-denied.html for other possibilities).

I’m not sure where there “Any” users (which showed in Red in phpMyAdmin) came from, but removing them clears the error.

This post is over 6 months old.

This means that, despite my best intentions, it may no longer be accurate.

This blog holds over 12 years of archived content - during that time, I may have changed my opinion of something, technology will have advanced (and old "best standards" may no longer be the case), my technology "know how" has improved etc etc - it would probably take me a considerable amount of time to update all the archival entries: and defeat the point of keeping them anyway.

Please take these posts for what they are: a brief look into my past, my history, my journey and "caveat emptor".

Leave a Reply

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


gamy-dance
%d bloggers like this: