Linux MySql新用户创建以及权限分配

创建用户只允许本地IP访问

create user 'lyy'@'localhost' identified by '123456';

创建用户允许外围访问

create user 'lyy'@'%' identified by '123456';

执行刷新授权

flush privileges;

授予用户通过外网操作某一个数据库所有权限

grant all privileges on `testdb`.* to 'lyy'@'%' identified by '123456';

授予用户外网操作所有数据库权限

grant all privileges on `*.*`.* to 'lyy'@'%' identified by '123456';

猜你喜欢

转载自blog.csdn.net/weixin_39709134/article/details/128016150
今日推荐