How to revoke permissions and delete MySQL users

Source: Internet
Author: User
Tags mysql view

It is not difficult to revoke permissions and delete MySQL users. The following describes how to revoke permissions and delete MySQL users and the detailed steps, which may help you.

Revoke permissions and delete MySQL users:

To cancel a user's permissions, use the REVOKE statement. The syntax of REVOKE is very similar TO the GRANT statement, except that it is replaced by from without the indetifed by and with grant option clauses:

REVOKE privileges (columns) ON what FROM user

The user part must match the user part of the user you want to revoke permission from the original GRANT statement. Privileges does not need to be matched. You can use the GRANT statement to GRANT permissions, and then use the REVOKE statement to REVOKE only some permissions.

The REVOKE statement only deletes permissions, but does not delete users. Even if you revoke all permissions, the user records in the user table are retained, which means that the user can still connect to the server.

To completely Delete a MySQL user, you must use a Delete statement to explicitly Delete user records from the user table:

% Mysql-u root mysqlmysql> Delete FROM user-> Where User = "user_name" and Host = "host_name"; mysql> flush privileges;

The Delete statement deletes user records, while the FLUSH statement tells the server to overload the authorization table. When you use the GRANT and REVOKE statements, the table is automatically reloaded, but you do not modify the authorization table directly .)
 

How to implement a dynamic MySQL View

Solution to querying garbled characters in MySQL

How to query time periods in MySql

Use MySQL temporary tables to accelerate queries

How to view MySQL binary logs

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.