I have been having this issue for weeks. I have no idea where to look next. I have cleaned, flushed, restarted MySQL
service, rebooted the Ubuntu
server. What can cause this WARNING
and the user to not show in the user
table? I've also tried to DROP user
and get 0 rows affected
as a result. This is frustrating beyond belief! Where else is user info stored in the Schema and how can I purge it?
UPDATE
When I grep the username in /var/lib/mysql/mysql
I find the username in the db.MYD
file. Although I cannot edit it . So I know the username exists somewhere OTHER than the user table.
Best Answer
This happens when a user is created and granted privileges and then deleted from mysql.user instead of being dropped:
First, create a user
admin_x@localhost
:Check if the user is in
mysql.user
:Okay.
Now we grant this user access to db
test
:And check it:
Now delete the user improperly from
mysql.user
:And the user is no longer in
mysql.user
:But when you now try to create it new, you get an error:
That is because
admin_x@localhost
still has privileges stored inmysql.db
:Now, when you drop the user
it is really gone and you can create it again: