Summary of level five permissions in MySQL

Source: Internet
Author: User

MySQL permissions control is mainly through the MySQL library under the Db,user,host,table_priv,column_priv Table control.

Because of the small amount of permission information data, MySQL loads all permission messages into memory at startup. So each time you manually modify the relevant permission table, you need to reload it by using the flush privileges command. However, if it is through grant,revoke or drop user,create user commands such as Modify permissions, you do not need to flush MySQL in a total of five levels of permissions, in order of size: Global > Database > Table > column, routine level is the ① of the stored procedure or function operation, global level control, and all permission information is stored in the Mysql.user table. The Global level is for the entire mysqld. Grant Select,create table on *. * to U1 identified by password; ②, the database level scope specifies all objects in the entire database. Grant Select,create table on databasename.* to U1 identified by password; User Database1;grant drop on * to ' U1 ' @ '% ', ' U1 ' @localhost, [email protected] '% '; The ③,table level scope is a specific table under the specified user, grant index on TEST.T1 to ' U1 ' @localhost ④, and the column level scope is certain columns in a specific table under a specific library. The column-level permissions are insert,select,update. Authorization method: Grant Select (C1,C2,C3) on test.t1 to ' U1 ' @localhost; ⑤, Routine levelroutine level of the permissions mainly only execute and alter Routine two, mainly for the object is procedure and function of the two objects, when authorized Routine level permissions, You need to specify the database and related objects. Grant execute on TEST.P1 to ' U1 '% ';

Summary of level five permissions in MySQL

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.