Fork me on Gitee

Linux下MySQL允许远程连接以及授权命令

--针对某个库做授权
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
例如:grant all on bank_reserve.* to bank@'%' identified by "zhongrui123@#" with grant option;
grant all on *.* to root@'%' identified by "123456" with grant option;

--收回某个库权限
revoke all on bool.* from myuser@'192.168.1.%';

--针对表做权限
grant insert,update,select on gy3.goods to lisi@'192.168.1.%';

-- 刷新权限

 flush privileges;

 

posted @ 2018-04-27 17:10  Luke-lu  阅读(225)  评论(0编辑  收藏  举报
AmazingCounters.com