mysql> select curdate(),version(),database(),user();
+------------+------------+------------+----------------+
| curdate() | version() | database() | user() |
+------------+------------+------------+----------------+
| 2017-07-25 | 5.7.16-log | NULL | root@localhost |
+------------+------------+------------+----------------+
1 row in set (0.01 sec)


二、创建用户并指定资源限制


-- 创建用户并指定最大连接数为3 (MySQL 5.7.6 和 更高版本有效)
create user one@'%' identified by 'one' with max_user_connections 3;


 三、锁定MySQL账户


mysql> alter user one@'%' account lock;
Query OK, 0 rows affected (0.09 sec)