mysql 添加新用户 赋予权限

时间:2021-04-18 08:49:39

 

创建新用户

grant all privileges on *.* to '用户名'@'可登录主机' identified by '密码' with grant option;

grant all privileges on *.* to 'test'@'%' identified by 'root' with grant option;

 

赋予新用户权限:

grant select,insert,update,delete on *.* to '用户名'@'可登录主机' identified by "密码";

例:

grant select,insert,update,delete on *.* to 'test'@'%' identified by "root";

刷新权限表

flush privileges;