mysql> grant all privileges on *.* to 'root'@'%' indentified 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 'indentified by 123456' with grant option' at line 1
原因: mysql的版本问题,这条语句适用于MySQL8.0之前

解决: mysql8.0及以上版本需要使用以下语句:

create user root@'%' identified by '123456'; 
grant all privileges on *.* to root@'%' with grant option;

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐