- MySQL 8.0 及以上版本的用户授权语句和之前版本不同,老版本的常用授权语句,在 MySQL 8.0 版本中 已不能使用,如使用旧版本授权语句会报错。 ```sql mysql> GRANT ALL PRIVILEGES ON *.* TO `lansky`@`%` IDENTIFIED BY '123456' 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 '000000' WITH GRANT OPTION' at line 1 ``` - 在 MySQL 8.0 及以上版本中正确授权语句 ```sql mysql> CREATE USER 'lansky'@'%' IDENTIFIED BY '123456'; mysql> GRANT ALL ON *.* TO 'lansky'@'%' WITH GRANT OPTION; ``` Last modification:February 8, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like If you think my article is useful to you, please feel free to appreciate