最近使用sql工具連接服務器mysql出現
(1045, "Access denied for user 'root 'IP號碼' (using password: YES)")
錯誤,查看過端口3306是否開放 以及雲服務器安全組是否配置3306端口后,感覺是mysql8沒有開放外部訪問,
查詢網上大多教程是針對mysql5.7的,直接執行
grant all privileges on *.* to 'root'@'%' identified by 'youdou123';
會出現
ERROR 1064 (42000):
以下是MySQL版本8.0.11正確的寫法:
use mysql;
desc user;
select host,user from user;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
然后就可以使用外部訪問了