User Permissions for MySQL Management

Source: Internet
Author: User
MySQL user management mysql authorization level · global level · database level (whether to delete the database to be created · table level · field level · three permission types that need to be understood at the storage process and storage function level · Management · Database category

MySQL user management mysql authorization level · global level · database level (whether to delete the database to be created · table level · field level · three permission types that need to be understood at the storage process and storage function level · Management · Database category



|
+ Shards +
| Grant usage on *. * TO 'test1' @ '%' identified by password' * 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 '|
| Grant create on 'wpdb'. * TO 'test1' @ '%' |
| Grant create on 'abc'. * TO 'test1' @ '%' |
| Grant select, INSERT, create on 'test1'. * TO 'test1' @ '%' |
| Grant create on 'mysql'. 'wpdb' TO 'test1' @ '%' |
+ Shards +
5 rows in set (0.00 sec)


|
| Grant create on 'abc'. * TO 'test1' @ '%' |
| Grant select, INSERT, CREATE, alter on 'test1'. * TO 'test1' @ '%' |
| Grant update (age) ON 'test1'. 'testtb' TO 'test1' @ '%' |
| Grant create on 'mysql'. 'wpdb' TO 'test1' @ '%' |
+ Shards +
6 rows in set (0.00 sec)



Mysql> showgrants for test1 @ '% ';
+ Shards +
| Grants for test1 @ % |
+ Shards +
| Grant usage on *. * TO 'test1' @ '%' identified by password' * 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 '|
| Grant create on 'wpdb'. * TO 'test1' @ '%' |
| Grant create on 'abc'. * TO 'test1' @ '%' |
| Grant insert, CREATE, alter on 'test1'. * TO 'test1' @ '%' |
| Grant update (age) ON 'test1'. 'testtb' TO 'test1' @ '%' |
| Grant create on 'mysql'. 'wpdb' TO 'test1' @ '%' |
+ Shards +
6 rows in set (0.00 sec)

Generally, select statements have read permissions, which can be granted. Other statements have write permissions. Therefore, you must carefully consider granting permissions.




This article is from the "mood is still" blog. Please keep this source

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.