Mysql8設定允許root使用者遠端訪問
阿新 • • 發佈:2021-04-29
按照mysql8.0以前的方法修改報錯
mysql> grant all privileges on *.* to 'root'@'%' identified by 'PASSWD';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
mysql8.0以後採用新的語法
create user 'root'@'%' identified by 'PASSWD'; grant all privileges on *.* to 'root'@'%';
mysql> create user 'root'@'%' identified by 'a123456';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.00 sec)