0

I think i'm stuck. Got MySQL server running great, when suddenly i lost access to it. It gives error

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

Also I can't login through phpmyadmin (incorrect password).

I've managed to use skip-grant-tables option to log in and see what's going on. Here is the mysql.user table:

| user | host +------+--------- | root | 127.0.0.1 | root | 195.14.50.18 | root | dlink-A9592D|

Also, SELECT PASSWORD=('my password here') gives the same hash as in the users table.

What am i doing wrong? Everything looks correct, except I can't login with correct password.

I've already tried to update users with new password (even empty, still doesnt work). Can't find answer in similar threads, so I'm asking here again.

upd. tried to remove mysql completely and install it again. And here is some magic:

In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here.
Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password : YES)

With any password (blank, old, any other)

bigbobr
  • 355
  • 4
  • 17
  • 1
    Read [this post](http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw?rq=1) – mseifert Sep 22 '14 at 01:47
  • `You probably have an anonymous user ''@'localhost' or ''@'127.0.0.1'` I might be blind, but there are no anonymous users here – bigbobr Sep 23 '14 at 15:12

1 Answers1

0

Solution that worked for me:
1. restart mysql with skip-grant-tables included in my.cnf;
2. drop all users;
3. create new user and give all privileges

bigbobr
  • 355
  • 4
  • 17