MySQL account permissions

Source: Internet
Author: User

MySQL permissions are divided into global permissions, library permissions, table permissions, corresponding to the MySQL library inside the user table, DB table, Tables_priv table.

Grant all privileges on *. *: Operation Mysql.user Table

Grant all privileges on db.*: Operation mysql.db Table

Grant all privileges on db.table: Operation Mysql.tables_priv Table

These three kinds of operations correspond to different tables, do not affect each other, give a user a large granularity of permissions, and can not recover the small granularity of permissions.

Examples are as follows:


[Email protected]:mysql3306.sock 14:02: [test]>grant all privileges on * * to [email protected] ' 127.0.0.1 ';

Query OK, 0 rows Affected (0.00 sec)

[Email protected]:mysql3306.sock 14:03: [test]>revoke Update on test.* from [email protected] ' 127.0.0.1 ';

ERROR 1141 (42000): There is no such grant defined for user ' test ' on host ' 127.0.0.1 '

[Email protected]:mysql3306.sock 14:03: [test]>revoke Update on TEST.A from [email protected] ' 127.0.0.1 ';

ERROR 1147 (42000): There is no such grant defined for user ' test ' on host ' 127.0.0.1 ' on table ' a '




MySQL account permissions

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.