MySQL server version for the right syntax to use near 'IDENTIFIED BY '**' WITH GRANT OPTION'

很久没在服务器上装环境,今天安装 MySQL 授权时报如题错误,我输入的命令是授权用户支持远程访问

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

原来从 MySQL 8 开始,不能支持一段式授权用户,需要先创建再授权。

mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
怎么说呢?不管有用没,还是想加上这句
老郭种树原创,转载请加上MySQL server version for the right syntax to use near ‘IDENTIFIED BY ‘**’ WITH GRANT OPTION’
点赞

发表评论

邮箱地址不会被公开。 必填项已用*标注