创建一个用户随着用户资源限制。 (root@localhost) [(none)]> GRANT ALL ON customer.* TO 'francis'@'localhost' -> WITH MAX_QUERIES_PER_HOUR 20 -> MAX_UPDATES_PER_HOUR 10 -> MAX_CONNECTIONS_PER_HOUR 5 -> MAX_USER_CONNECTIONS 2;
一下验证当前用户的资源限制 root@localhost) [(none)]> select * from mysql.user where user='francis'\G *************************** 1. row *************************** Host: localhost User: francis Password: Select_priv: 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: 20 max_updates: 10 max_connections: 5 max_user_connections: 2 plugin: mysql_native_password authentication_string: password_expired: N 1 row in set (0.00 sec)