I am trying to create new user in mysql,
create user 'saravanakumar'@'localhost' identified by 'saravanakumar';
it shows error as,
ERROR 1396 (HY000): Operation CREATE USER failed for 'saravanakumar'@'localhost'
after I read this
ERROR 1396 (HY000): Operation CREATE USER failed for 'jack'@'localhost'
I delete user.But I can't.It shows
mysql> SELECT User FROM mysql.user;
+---------------+
| User |
+---------------+
| root |
| saravanakumar |
| saravanakumar |
| |
| root |
| saravanakumar |
| |
| root |
+---------------+
8 rows in set (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT User FROM mysql.user;
+---------------+
| User |
+---------------+
| root |
| saravanakumar |
| saravanakumar |
| |
| root |
| saravanakumar |
| |
| root |
+---------------+
8 rows in set (0.00 sec)
how can i delete all these user in table and how can i create a single user.What is the root cause of this problem? experts please help me.
Best Answer
Does indeed indicate that the user already exists or did exist.
FLUSH PRIVILEGES doesn't delete users.
You are looking for DROP USER.
http://dev.mysql.com/doc/refman/5.1/en/drop-user.html
Order of buisness would be:
You will probably need to flush privileges if you use delete from (do not). Remember: this does not necessarily revoke all the privileges this user may have (like table privileges), you will have to do this yourself - if you don't you may not be able to recreate the user.
"user" requires you to specify an account name
and
Additional reading: http://dev.mysql.com/doc/refman/5.1/en/account-names.html
Please read those bug reports for further clarification
http://bugs.mysql.com/bug.php?id=28331
http://bugs.mysql.com/bug.php?id=62255