1. 程式人生 > 其它 >leecode_python中檔題:2.兩數相加

leecode_python中檔題:2.兩數相加

技術標籤:資料庫mysqllinuxjavapython

問題

mysql> grant all privileges on *.* to 'root'@'%';
ERROR 1410 (42000): You are not allowed to create a user with GRANT
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

解決

  8.0版本資料庫已經不支援該語法

正確的寫法是先建立使用者
CREATE USER 'root'@'%' IDENTIFIED BY 'Hadoop3!';
再給使用者授權
grant all privileges on *.* to 'root'@'%' ;