Home > Database > Mysql Tutorial > body text

How to access Mysql through SSH tunnel forwarding

藏色散人
Release: 2020-03-12 08:43:33
forward
2433 people have browsed it

Access Mysql through SSH channel forwarding

Scenario:

Mysql服务器: test.cn
    Mysql_Listen: 127.0.0.1:3306
    SSH_Port: 8888
Client : local.cn
Copy after login

SSH channel forwarding

ssh -fNg -p 8888 -L 3306:127.0.0.1:3306 User@test.cn
Copy after login

Check whether there is a local 3306 port Monitor

ss -lntp |grep '3306'
Copy after login

Mysql Client connection

mycli -h localhost -P 3306 -u user -p password
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template