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 delete a mysql user name

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces how to delete the mysql user name, the article is very detailed, has a certain reference value, interested friends must read it!

The method to delete the mysql user name is: 1, delete the user name using drop, the syntax is [drop user XXX; delete the existing user]; 2, delete the user name using delete, and the syntax is [delete from user where user='XXX' and host='..'].

The method to delete the mysql user name:

1. Delete using drop

Drop user XXX; deletes existing users. By default, the user 'XXX'@'%'' is deleted.

If there are other users such as' XXX'@'localhost', etc., they will not be deleted together. If you want to delete 'XXX'@'localhost', you need to add host, that is, drop user' XXX'@'localhost' when you use drop to delete.

2. Delete using delete

Delete from user where user='XXX' and host='localhost'; where XXX is the user name and localhost hostname

3. Difference

Drop deletes not only the data in the user table, but also the contents of other permissions tables.

Delete only deletes the contents of the user table, so you need to perform FLUSH PRIVILEGES; refresh permissions after deleting a user using delete, otherwise an error will be reported the next time you create a user using the create statement.

The above is how to delete all the contents of the mysql user name, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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