https://jingyan.baidu.com/article/8cdccae9bdef64705413cdd6.html
mysql8創建遠程登錄用戶:
mysql,進入mysql
1.create user root@'%' identified by 'root'; #創建遠程登錄用戶及密碼
2.grant all privileges on *.* to root@'%' with grant option; #給遠程登錄用戶賦值所有權限
3.ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; #mysql8使用的是caching_sha2_password加密規則,最簡單的方法是修改遠程連接用戶的加密規則為mysql_native_password
4.flush privileges; #刷新一下,使配置生效
1.show global variables like 'port'; #查看數據庫啟用端口
1.檢查遠程服務器的防火牆:
systemctl start firewalld # 開啟防火牆
systemctl stop firewalld # 關閉防火牆
systemctl status firewalld #檢查防火牆狀態
2.如果防火牆開啟,就將3306端口加入到防火牆中:
查看防火牆開放的端口命令:firewall-cmd --list-ports
向防火牆中添加端口,例如添加3306端口名利如下:
firewall-cmd --permanent --zone=public --add-port=3306/tcp
開啟已經配置好的jenkins的端口,然后在重啟防火牆,注意一定要重啟防火牆,命令如下:
systemctl reload firewalld