mysql> grant select on sys.* to 'perf'@'127.0.0.1' identified by '123'; Query OK, 0 rows affected, 1 warning (0.01 sec) -- 这里有一个warning
mysql> show warnings; -- 输入warning的Message如下: -- Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
mysql> select * from mysql.user where user='perf'\G *************************** 1. row *************************** Host: 127.0.0.1 User: perf Select_priv: N ---由于perf用户是对sys库有权限,所以这里(USER)全是N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: N Grant_priv: N References_priv: N Index_priv: N Alter_priv: N Show_db_priv: N Super_priv: N Create_tmp_table_priv: N Lock_tables_priv: N Execute_priv: N Repl_slave_priv: N Repl_client_priv: N Create_view_priv: N Show_view_priv: N Create_routine_priv: N Alter_routine_priv: N Create_user_priv: N Event_priv: N Trigger_priv: N Create_tablespace_priv: N ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 plugin: mysql_native_password authentication_string: *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 password_expired: N password_last_changed: 2015-11-18 12:20:13 password_lifetime: NULL account_locked: N -- 如果这里为Y,该用户就无法使用了 1 row in set (0.00 sec)
mysql> select * from mysql.db whereuser='perf'\G *************************** 1.row *************************** Host: 127.0.0.1 Db: sys-- sys 数据库 User: perf Select_priv: Y -- 有select权限,和我们赋予perf的权限一致 Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Grant_priv: N References_priv: N Index_priv: N Alter_priv: N Create_tmp_table_priv: N Lock_tables_priv: N Create_view_priv: N Show_view_priv: N Create_routine_priv: N Alter_routine_priv: N Execute_priv: N Event_priv: N Trigger_priv: N 1rowinset (0.00 sec)
mysql> use information_schema; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> select * from INNODB_CMP; ERROR 1227 (42000): Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
mysql> show variables like "%proxy%"; +-----------------------------------+-------+ | Variable_name | Value | +-----------------------------------+-------+ | check_proxy_users | ON | | mysql_native_password_proxy_users | ON | | proxy_user | | | sha256_password_proxy_users | OFF | +-----------------------------------+-------+ 4 rows in set (0.00 sec)