Mysql_faq:error 1396 (HY000): Operation CREATE USER failed for ' username ' @ ' hostname '

Source: Internet
Author: User
Tags server memory

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.