MySQL8设置用户权限报错You have an error in your SQL syntax;right syntax to use near ‘IDENTIFIED BY

mysql 8 设置用户权限命令和之前不一样
之前:
grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;

报错:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IDENTIFIED BY ‘123456’ WITH GRANT OPTION’ at line 1

现在:
CREATE USER 'myuser'@'%' IDENTIFIED BY '123456'; #创建用户
grant all privileges on *.* to 'myuser'@'%' ; #分配权限
FLUSH PRIVILEGES; #刷新权限

posted @   呼长喜  阅读(321)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
历史上的今天:
2019-03-18 Zabbix监控Oracle数据库
点击右上角即可分享
微信分享提示