Suzf.net Pure handmade 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0028.gif "alt=" J_0028.gif "/>
The following error occurred while managing MySQL permissions: Error 1396 (HY000): Operation CREATE USER failed for ' username ' @ ' hostname '
But this user only really exists. Recall a previous action: first create a user with the grant statement, and then change the permissions to update the Mysql.user data. As a result, the above error occurs.
Workaround: Remove Invalid/conflicting user authorizations and re-authorize on demand.
This means that MySQL privilege control is best used in a unified manner.
FLUSH privileges does not delete the user, but instead re-loads the permissions from the authorization table in the MySQL database.
GRANT, create USER, create server, and INSTALL PLUGIN statements are cached in server memory. The memory will not be freed by the corresponding revoke, drop USER, Drop SERVER, and UNINSTALL PLUGIN statements, so there will be an increase in memory usage for too many instances of executing the statement. The cache memory can be freed using FLUSH privileges.
DROP USER
DROP USER User[,user] ...
Http://dev.mysql.com/doc/refman/5.1/en/drop-user.html
DROP USER ' username ' @HOSTNAME;
CREATE USER ' username ' @HOSTNAME [identified by ' Password '];
You may need to delete the Refresh permission if you use it.
Remember: This does not necessarily revoke all permissions that the user may have (such as a table's permissions) that you will have to do
If you do not do this, you may not be able to recreate the user.
REVOKE all privileges, GRANT OPTION from ' username ' @HOSTNAME;
DELETE from Mysql.user WHERE user= ' username ';
FLUSH privileges;
CREATE USER ' username ' @HOSTNAME [identified by ' Password '];
The user's account name is equivalent:
To "user_name ' @ '% '. For example, ' user_name ' equals ' user_name ' @ '% '.
Supplementary reading: Http://dev.mysql.com/doc/refman/5.1/en/account-names.html
Please read further bugs:
http://bugs.mysql.com/bug.php?id=28331
http://bugs.mysql.com/bug.php?id=62255
This article is from the "Jeffrey blog" blog, please be sure to keep this source http://oceanszf.blog.51cto.com/6268931/1665241
Mysql_faq:error 1396 (HY000): Operation CREATE USER failed for ' username ' @ ' hostname '