mysql 用户授权_MySQL
程序员文章站
2022-05-14 19:47:58
...
无意义,备忘
1.授权
--授权app用户从指定IP访问数据库的所有权限
grant all privileges on *.* to 'app'@'10.200.12.232' identified by 'app1234';
--取消授权
revoke alter on *.* from 'app'@'10.200.12.232' identified by 'app1234';
--授权app用户从指定IP访问downloaddb数据库的表(增删改查)
GRANT select,insert,update,delete ON downloaddb.* TO 'app'@'10.200.12.199' IDENTIFIED BY 'app1234' WITH GRANT OPTION;
--取消授权
revoke select,insert,update,delete ON downloaddb.* from 'app'@'10.200.12.199' IDENTIFIED BY 'app1234';
2.刷新权限
--刷新权限
FLUSH PRIVILEGES;
3,grant all privileges on *.* to 'root'@'%' identified by 'xxxxx';
容许外部所有ip访问