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'@'%';

posted @ 2020-03-09 16:43  向之礼  阅读(218)  评论(0)    收藏  举报