In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 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 mysql users, the article is very detailed, has a certain reference value, interested friends must read it!
The DROP USER statement can be used in the MySQL database to delete one or more user accounts and related permissions.
Syntax format:
DROP USER [,]...
You should pay attention to the following points when using DROP USER statements:
The DROP USER statement can be used to delete one or more MySQL accounts and revoke their original permissions.
To use the DROP USER statement, you must have DELETE permissions or global CREATE USER permissions for the MySQL database in MySQL.
In the use of the DROP USER statement, if the hostname of the account is not explicitly given, the hostname defaults to "%".
Note: users' deletions do not affect their previously created tables, indexes, or other database objects, because MySQL does not record who created these objects.
[instance] use DROP USER statement to delete user 'jack'@'localhost'. The SQL statement entered and the execution procedure are shown below.
Mysql > DROP USER 'jack'@'localhost'
In the Windows command line tool, log in to the database server using jack and password lion, and find that the login failed, indicating that the user has been deleted, as shown below.
C:\ Users\ USER > mysql-h localhost-u jack-pEnter password: * ERROR 1045 (28000): Access denied for user 'jack'@'localhost' (using password: YES)
Expand
Drop
Drop user XXX
Delete existing users, the default is' XXX'@'%' this user, if there are other users, such as' XXX'@'localhost', etc., 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.
Delete
Delete from user where user='XXX' and host='localhost'
Where XXX is the user name and localhost hostname.
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 mysql deletes all the user's content, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.