擅长:python、mysql、java
<p>很有魅力。在</p>
<pre><code>In [1]: from sshtunnel import SSHTunnelForwarder
...: ...:
...: ...: with SSHTunnelForwarder(
...: ...: ('xx.xx.xx.xx', 22),
...: ...: ssh_username='deploy',
...: ...: ssh_pkey='~/.ssh/id_rsa',
...: ...: remote_bind_address=('127.0.0.1', 3306),
...: ...: local_bind_address=('0.0.0.0', 3307)
...: ...: ) as tunnel:
...: ...: print('pass')
...:
...:
pass
</code></pre>