You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

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

在mysql5.7之前

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的数据库密码' WITH GRANT OPTION;

这个语句就被启用了
如果想赋给权限可以使用

create user root@'ip地址' identified by '密码';
grant all privileges on root.* to root@'IP地址';
flush privileges;

你可能感兴趣的:(sql,数据库)