我使用
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' 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 ‘root’ WITH GRANT OPTION’ at line 1.
也试过了
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
报
ERROR 1410 (42000): You are not allowed to create a user with GRANT
MySQL(8.0.11.0)用户名/密码是 root/root.
从 MySQL 8 开始,不可以(隐式)使用
GRANT
命令创建用户。改用CREATE USER
,然后再使用GRANT
声明:mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'root'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
你的答案