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