具體權(quán)限
https://images2018.cnblogs.com/blog/1479220/201809/1479220-20180911160815293-907297832.png
建議
https://images2018.cnblogs.com/blog/1479220/201809/1479220-20180911155738298-211843872.png
操作
查看用戶的權(quán)限
show grants for brian@'localhost';
用戶授權(quán)(兩種方法)
1碎浇、創(chuàng)建用戶然后授權(quán)
創(chuàng)建用戶
help create user;
create user brian@'localhost' identified by '123456';
# 授權(quán)
help grant;
所有權(quán)限庫(kù)的所有表
create user brian@'localhost' identified by '123456';
grant all on briandata.* to brian@'localhost';
2菲盾、一條命令授權(quán)
grant all on briandata.* to brian@'localhost' identified by '123456';
根據(jù)網(wǎng)段和IP進(jìn)行授權(quán)
grant all on briandata.* to brian@'192.168.10.%' identified by '123456';
grant all on briandata.* to brian@'192.168.10.0/255.255.255.0' identified by '123456';
回收權(quán)限(revoke)
revoke insert on briandata.* from 'brian'@'localhost';
# 查看用戶的權(quán)限(對(duì)應(yīng)的權(quán)限會(huì)變成Y)
select * from mysql.user\G;