Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of ERROR 1396 (HY000) error in Mysql

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following brings you about Mysql ERROR 1396 (HY000) error report how to solve, if you are interested, let's take a look at this article, I believe that after reading Mysql ERROR 1396 (HY000) error report how to solve how to help you more or less.

This error is reported when creating a user:

ERROR 1396 (HY000): Operation CREATE USER failed for 'abc'@'localhost'

The reason is that you already have this user in mysql. Delete the delete directly from the mysql.user, then refresh the permission FLUSH PRIVILEGES, and then create the user without this problem.

If it is drop user, the interior of mysql will be refreshed automatically, so there will be no such problem when it is rebuilt.

Give an example of 1--delete deletion:

Mysql > create user 'abc'@'localhost'

Query OK, 0 rows affected (0.00 sec)

Mysql > select user,host from user

+-+ +

| | user | host |

+-+ +

| | root | 127.0.0.1 | |

| | abc | localhost |

| | root | localhost |

+-+ +

3 rows in set (0.00 sec)

Mysql > delete from user where user='abc'

Query OK, 1 row affected (0.00 sec)

Mysql > select user,host from user

+-+ +

| | user | host |

+-+ +

| | root | 127.0.0.1 | |

| | root | localhost |

+-+ +

2 rows in set (0.00 sec)

Create a user with the same name again, and the error is as follows:

Mysql > create user 'abc'@'localhost'

ERROR 1396 (HY000): Operation CREATE USER failed for 'abc'@'localhost'

To refresh permissions here, you can create them after refreshing.

Mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Mysql > create user 'abc'@'localhost'

Query OK, 0 rows affected (0.00 sec)

Mysql > select user,host from user

+-+ +

| | user | host |

+-+ +

| | root | 127.0.0.1 | |

| | abc | localhost |

| | root | localhost |

+-+ +

3 rows in set (0.00 sec)

For example, to delete 2--drop, you can directly create:

Mysql > drop user 'abc'@'localhost'

Query OK, 0 rows affected (0.00 sec)

Mysql > select user,host from user

+-+ +

| | user | host |

+-+ +

| | root | 127.0.0.1 | |

| | root | localhost |

+-+ +

2 rows in set (0.00 sec)

Mysql > create user 'abc'@'loaclhost'

Query OK, 0 rows affected (0.00 sec)

Read the above about Mysql ERROR 1396 (HY000) error report how to solve the details, whether there is anything to gain. If you want to know more about it, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report