mysql数据库赋予权限 版本语法差异
Posted 廿二又
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql数据库赋予权限 版本语法差异相关的知识,希望对你有一定的参考价值。
报错信息
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
ERROR 1064 (42000): 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
-- 赋予权限 (5.7)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
-- 赋予权限 (版本8.0语法)
GRANT ALL privileges ON *.* to 'root'@'%';
以上是关于mysql数据库赋予权限 版本语法差异的主要内容,如果未能解决你的问题,请参考以下文章