姬長信(Redy)

如何在MySQL 8.0中为root用户授予所有权限


试着
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.