mysql5.7创建用户 分配权限

创建用户(%表示随处可登录,localhost表示只能本地登录

create user 'username'@'%' identified by 'password';

 

分配权限

grant all privileges on tableName.* to 'username'@'%';

 

刷新权限

flush privileges;

 

如果报错ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

先执行flush privileges;再进行操作

posted @ 2020-04-07 11:33  uzxin  阅读(729)  评论(0编辑  收藏  举报