Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql: cannot create user after delete the user with phpmyadmin

I was trying to create a mysql user with:

$ mysql5 -u root -p
$ [enter password]
$ create user 'name'@'localhost' indentified by '123456';

Then I accidentally deleted the user while using phpMyAdmin.

So I came back to terminal to create the user again with the lines above. Then it gives me an error:

ERROR 1396 (HY000): Operation CREATE USER failed for 'name'@'localhost'

How do I fix this? I need to create the user with the same name and password.

Thanks in advance,

Milo

like image 774
hoyomi Avatar asked Jun 09 '26 15:06

hoyomi


1 Answers

It's very hard to see the issue here without some testing, but you may want to try:

flush privileges;
like image 165
smp7d Avatar answered Jun 11 '26 18:06

smp7d



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!