Permission to change or delete the search
Grant Select on testdb.* to [email protected] '% 'Grant Insert on TestDB. * to [email protected] '% 'Grant Update on TestDB. * to [email protected] '% 'Grant Delete on TestDB. * to [email protected] '% '
Grant SELECT, INSERT, UPDATE, delete on testdb.* to [email protected] '% '
all permissions where the keyword "privileges" can be omitted. Grant all privileges on database_name. * to [e-mail protected] identified by "000000";
Grant Advanced DBA manages permissions for all databases in MySQL.
Grant all on * * to [email protected] ' localhost '
Create modify, delete permissions for table
Grant create on testdb.* to [email protected] ' 192.168.0.% ';
Grant ALTER on testdb.* to [email protected] ' 192.168.0.% ';
Grant drop on testdb.* to [email protected] ' 192.168.0.% ';
Foreign key Operation permissions
Grant references on testdb.* to [email protected] ' 192.168.0.% ';
Temporary table permissions
Grant create temporary tables on testdb.* to [email protected] ' 192.168.0.% ';
Index permissions
Grant index on testdb.* to [email protected] ' 192.168.0.% ';
Grant acts on stored procedures, functions:
Grant execute on procedure testdb.pr_add to ' dba ' @ ' localhost '
Grant execute on function testdb.fn_add to ' dba ' @ ' localhost '
Grant action on a column in a table
Grant Select (ID, SE, rank) on testdb.apache_log to [email protected];
Grant functions can be divided into multiple levels
1.grant on the entire MySQL server
Grant SELECT On *. * to [email protected]; --DBAs can query tables in all databases in MySQL.
Grant all on * * to [email protected];--DBA can manage all databases in MySQL
2.grant Single Library
Grant all on test.* to [email protected];
3.grant Single Table
Grant all on test.tb1 to [email protected];
4.grant Multiple columns
Grant Select (id,name) on test.tb1 to [email protected]
5.grant stored procedures, functions
Grant execute on procedure testdb.pr_add to ' dba ' @ ' localhost '
Grant execute on function testdb.fn_add to ' dba ' @ ' localhost '
To view the current user (own) permissions:
Show grants;
To view additional MySQL user rights:
Show grants for [email protected];
REVOKE permission replace with revoke to the From
MySQL Grant command