There is a need for a project: divide the table into permissions and divide them into different enterprises.
At that time, navicat was used to manually add the customer and divide the permissions. I don't know why I couldn't log on to the database. I still need to study it ..........
Later, my colleague song implemented it using the command line as follows:
Create a user:
Create user 'test1' @ '%' identified by 'test1 ';
Authorization: Assign the select permission on the table nb_acclist to test1.
Grant select on sync_users.nb_acclist to test1 @ '%' identified by 'test1 ';
View User Permissions:
Mysql> show grants for test1;
+ Shards +
| Grants for test1 @ % |
+ Shards +
| Grant usage on *. * To 'test1' @ '%' identified by password' * 06c0bf5b64ece2f648b5f048a74153906ba08e5c '|
| Grant select on 'sync _ users'. 'nb _ acclist' to 'test1' @ '%' |
+ Shards +
2 rows in SET (0.00 Sec)