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;再进行操作


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM