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

The solution to the error of rebuilding a user account by mysql

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

Share

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

I do not know if you have any knowledge of previous articles such as mysql rebuilding a user account error solution, today I am here to give you a brief introduction. If you are interested, let's take a look at the text. I'm sure you'll get something after reading mysql to rebuild a user's account.

Description: after the user molewan is deleted in MariaDB, the business needs to re-establish a user named molewan

1. Check the database and find that there are no molewan users anymore.

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 and report an error

MariaDB [mysql] > create user molewan@'10.10.10.%' identified by 'molewan';ERROR 1396 (HY000): when Operation CREATE USER failed for' molewan'@'10.10.10.%' remembered to delete a molewan user, it was MariaDB [mysql] > delete from mysql.user where user= "molewan1" and host = "10.10.10.%" deleted by the delete command; MariaDB [mysql] > flush privileges

3. Check the information and find that if you want to completely not apply to a certain user, it is recommended to use the drop command.

MariaDB [mysql] > drop user molewan@'10.10.10.%';Query OK, 0 rows affected (0.00 sec) MariaDB [mysql] > flush privileges;Query OK, 0 rows affected (0.00 sec)

Note: DROP USER does not automatically terminate connected user sessions, that is, if the deleted user has connected to the CVM before deletion and the connection has not been interrupted, it can continue to perform certain operations at this time, but its identity has changed to household registration.

4. Users who rebuild molewan

MariaDB [mysql] > create user molewan@'10.10.10.%' identified by 'molewan';Query OK, 0 rows affected (0.01sec) MariaDB [mysql] > select user,host from mysql.user +-+-+ | user | host | +-+-+ | molewan | 10.10.10.% | | admin | localhost | +-+-+ 2 rows in set (0.00 sec)

What do you think after reading the article about how to solve the problem of rebuilding a user's account by mysql? 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