google "mysql 8 remote access ssl"
google "gcp mysql 遠程連接"
MySQL 8 的新特性與解決方式
http://www.manongjc.com/article/13483.html
* 創建用戶與授權方式的改變
* 遠程連結強制加密
* 預設為 caching_sha2_password
Mysql 允許外部連入
https://contemplator.github.io/blog/2018/06/06/Mysql-%E5%85%81%E8%A8%B1%E5%A4%96%E9%83%A8%E9%80%A3%E5%85%A5/
* 修改 Mysql 設定檔 - /etc/mysql/mysql.conf.d/mysqld.cnf
註解原本的 bind-address
* 修改後需要重啟 mysql
$ sudo service mysql restart
* 開通防火牆
如果是 Google Cloud ,就是去開通防火牆端口,
如果是其他的 VPS ,則可能是參考如下:
如果是 Google Cloud ,就是去開通防火牆端口,
如果是其他的 VPS ,則可能是參考如下:
$ /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
eht0 是 網路卡名稱,比如說查出來的結果是 ens3
查詢的方式,在 VPS server 輸入以下指令
$ ifconfig
* 測試是否可以連到 mysql,先不論帳號密碼和權限
telnet <your-mysql-ip> 3306
How to Enable SSL and Remote Connections for MySQL on CentOS 7
https://www.howtoforge.com/tutorial/how-to-enable-ssl-and-remote-connections-for-mysql-on-centos-7/
https://www.howtoforge.com/tutorial/how-to-enable-ssl-and-remote-connections-for-mysql-on-centos-7/