ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost'

user3086014 picture user3086014 · Dec 20, 2013 · Viewed 76.3k times · Source

I have created a user in mysql. Now i want to delete the user ? How to do that? I am getting this error :

ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost'

I am using this command :

DROP USER 'user'@'localhost';

Its an amazon machine.

Thanks

Answer

user3086014 picture user3086014 · Dec 20, 2013

It was because i created the user using command :

CREATE USER 'user'@'%' IDENTIFIED BY 'passwd';

and i was deleting it using :

drop user 'user'@'localhost';

and i should have used this command :

drop user 'user'@'%';