MySQL Rights Management

Source: Internet
Author: User

# # Part1: Authorization # Authorization is granting certain permissions to a user. # example 1: Grant the test user the SELECT permission on all tables of the ABC library. GRANT SELECT on ' abc '. * to ' test ' @ ' localhost '; # example 2: Grant test users all permissions (including grant permissions) for all tables in all libraries. GRANT all privileges on * * to ' test ' @ ' localhost ' with GRANT OPTION;
# # Part2: Reclaim permissions # Revoke a permission is a certain permission to cancel a user. # example 1: Recover the SELECT permission of the test user. REVOKE SELECT on * * from ' test ' @ ' localhost '; # example 2: Retract all the permissions of the test user (including grant permissions). REVOKE all privileges, GRANT OPTION on * * from ' test ' @ ' localhost ';
# # Part3: Viewing permissions # There are two ways to view permissions, one is to view the Mysql.user table directly, and the other is to view it through the show grants statement. # example 1: Get the [email protected] permission by viewing the Mysql.user table. SELECT * from ' MySQL '. ' User ' WHERE ' user ' = ' root ' and ' Host ' = ' localhost '; # example 2: View the current user's permissions through the show grants statement. Show grants;# Example 3: View the permissions of the test user through the show GRANTS statement. SHOW GRANTS for ' test ' @ ' localhost ';


This article is from the "Last Night Stars" blog, please make sure to keep this source http://yestreenstars.blog.51cto.com/1836303/1682529

MySQL Rights Management

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.