Why am I receiving this - error 1045 (28000)?
I just installed a fresh copy of Ubuntu 10.04.2 LTS on a new machine. I logged into MySQL as root:
david@server1:~$ mysql -u root -p123
I created a new user called repl. I left the host blank, so the new user may have access from any location.
mysql> CREATE USER 'repl' IDENTIFIED BY '123';
Query OK, 0 rows affected (0.00 sec)
I checked the user table to verify the new user repl was properly created.
mysql> select host, user, password from mysql.user;
+-----------+------------------+-------------------------------------------+
| host | user | password |
+-----------+------------------+-------------------------------------------+
| localhost | root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| server1 | root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| 127.0.0.1 | root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| ::1 | root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
| localhost | | |
| server1 | | |
| localhost | debian-sys-maint | *27F00A6BAAE5070BCEF92DF91805028725C30188 |
| % | repl | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
+-----------+------------------+-------------------------------------------+
8 rows in set (0.00 sec)
I then exit, try to login as a user repl, but access is denied.
david@server1:~$ mysql -u repl -p123
ERROR 1045 (28000): Access denied for user 'repl'@'localhost' (using password: YES)
david@server1:~$ mysql -urepl -p123
ERROR 1045 (28000): Access denied for user 'repl'@'localhost' (using password: YES)
david@server1:~$
Why is access denied?
This error 1045 (28000) could be an issue with corruption of your mysql database. Tables inside mysql databases like user tables can get corrupt and may cause issues.
Please do a check on those
myisamchk /var/lib/mysql/mysql/ *.MYI
Usually while checking or fixing myisam tables we would like to take mysql down first. If this problem is still not solved please try this out as well.
If they are corrupt then you can fix them using
myisamchk --silent --force --fast /path/table-name.MYI