MySQL permission level

Source: Internet
Author: User

MySQL has the following permissions:

1. Global Level:

Global Level permission control is also called Global permission control. All permission information is stored in the mysql. user table.

All permissions of Global Level are for the entire mysqld and are valid for all tables and fields in all databases.

Grant select, UPDATE, DELETE, insert on *. * TO 'def '@ 'localhost ';

Global Level has the following permissions)

2. Database Level

Database Level has a scope of all objects in the specified Database.

Grant alter on test. * TO 'def '@ 'localhost ';

Grant drop on * TO 'def '@ 'localhost ';

Database Level has the following permissions: create user, FILE, PROCESS, RELOAD,

Replication client, replication slave,

Show databases, SHUTDOWN, SUPER, and USAGE permissions are not added.

3. Table Level

The Table Level Permission applies to the specified Table of the database specified in the authorization statement.

Grant index on test. t1 TO 'abc' @ '% .jianzhaoyang.com ';

Table Level permissions are limited to a specific Table, so there are few permission types, only
ALTER, CREATE, DELETE, DROP, INDEX, INSERT, select update.

4. Column Level

The permission of Column Level has a smaller scope. It is only a specified (active) Column of a table.

Grant select (id, value) ON test. t2 TO 'abc' @ '%. XXX ';

Column-Level permissions include INSERT, SELECT, and UPDATE.

5. Routine Level

Routine Level mainly targets the procedure and function objects. When granting Routine Level permissions, you must specify the database and related objects.

Grant execute on test. p1 to 'abc' @ 'localhost ';

Routine Level has only two permissions: EXECUTE and alter routine.

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.