MySQL rebuilds a user account (ERROR 1396 (HY000): Operation CREATE User failed)

Source: Internet
Author: User

Description: After removing the user Molewan in Mariadb, the business has a need to re-establish a user named Molewan

1, check the database, found that no Molewan users

MariaDB [mysql]> Select User,host from mysql.user;+----------+------------+| user | Host |+----------+------------+| Molewan1 | 10.10.10.% | | admin | localhost |+----------+------------+2 rows in Set (0.00 sec)

2, create a new Molewan user, error

MariaDB [mysql]> Create user [email protected] ' 10.10.10.% ' identified by ' Molewan '; ERROR 1396 (HY000): Operation CREATE user failed for ' Molewan ' @ ' 10.10.10.% ' when remembered to delete Molewan user, is deleted by Delete command MARIADB [ Mysql]> Delete from Mysql.user where user= "molewan1" and host = "10.10.10.%"; MariaDB [mysql]> flush Privileges;

3, check the information, found that if you want to completely do not apply to a user, we recommend using the Drop command

MariaDB [mysql]> Drop User [email protected] ' 10.10.10.% '; Query OK, 0 rows Affected (0.00 sec) MariaDB [mysql]> flush privileges; Query OK, 0 rows Affected (0.00 sec)

Added: The DROP user does not automatically abort a connected session, that is, if the deleted user has already connected to the server before the deletion, and the connection has not been interrupted, then it can continue to perform certain operations at this time, but its identity has become heihu.

4. Rebuilding Molewan Users

MariaDB [mysql]> Create user [email protected] ' 10.10.10.% ' identified by ' Molewan '; Query OK, 0 rows affected (0.01 sec) MariaDB [mysql]> Select User,host from mysql.user;+---------+------------+| user | Host |+---------+------------+| Molewan | 10.10.10.% | | admin | localhost |+---------+------------+2 rows in Set (0.00 sec)






This article is from the "Frozen vs watermelon" blog, so be sure to keep this source http://molewan.blog.51cto.com/287340/1940610

MySQL rebuilds a user account (ERROR 1396 (HY000): Operation CREATE User failed)

Related Article

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.