描述
GRANT ALL PRIVILEGES ON . TO ‘root’@'xxx’ IDENTIFIED BY ‘root’ 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 ‘xxxxx’ WITH GRANT OPTION’ at line 1
原因
新版本mysql添加用户权限命令分开,要先创建然后赋予权限。
create user 'root'@'%' ;
补充:%代表全部地址,也可以特指 ,不写密码就是公共秘钥连接。
create user 'root'@'%' identified by '密码';
这是需要密码的
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
flush privileges;