mysql 新建*用户 和只读用户

mysql 新建*用户 和只读用户

全权限用户

CREATE USER 'root'@'%' IDENTIFIED BY 'xxxx';

show grants for 'root'@'%';

GRANT all privileges ON *.* TO 'root'@'%';

只读用户

CREATE USER 'foo'@'%' IDENTIFIED BY 'xxxx';

GRANT select ON *.* TO 'foo'@'%';

show grants for 'foo'@'%';

删除权限

REVOKE ALL ON mysql01.* FROM 'michael02'@'%';