mysql> create user oldboy@'10.0.0.%' identified by '123';
#8.0以前,可以自动创建用户并授权
mysql> grant all on *.* to oldguo@'10.0.0.%' identified by '123';
mysql> select user,host from mysql.user;
mysql> alter user root@'localhost' identified by '123456';
mysql> drop user oldguo@'10.0.0.%' ;
#权限列表
#SELECT,INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE
# 赋予所有权限,不包括授权
mysql> grant all on *.* to root@'%' identified by '123';
# 赋予授权权限
mysql> grant all on *.* to root@'%' identified by '123' with grant option;
mysql> show grants for wordpress@'10.0.0.%';
mysql> revoke delete on wordpress.* from 'wordpress'@'10.0.0.%';