Access Mysql through SSH channel forwarding
Scenario:
Mysql服务器: test.cn Mysql_Listen: 127.0.0.1:3306 SSH_Port: 8888 Client : local.cn
SSH channel forwarding
ssh -fNg -p 8888 -L 3306:127.0.0.1:3306 User@test.cn
Check whether there is a local 3306 port Monitor
ss -lntp |grep '3306'
Mysql Client connection
mycli -h localhost -P 3306 -u user -p password
Recommended mysql video tutorial, address: https://www.php.cn/course/list/51.html
The above is the detailed content of How to access Mysql through SSH tunnel forwarding. For more information, please follow other related articles on the PHP Chinese website!