I need to SSH into a db using Python, I'm using PythonDB for this. I saw this question which details how to do this but I can't seem to get the syntax right. Would someone be able to point me in the right direction....? I also need to use a private key, how would I go about inserting that...?
ssh -L 9990:127.0.0.0:3396 <79.xxx.xx.xxx>
database = MySQLdb.connect(host'127.0.0.0', port=3306, user='jack', passwd='pass', db='test')
123 -> 80for instance, if you connect to 127.0.0.1:123 you'll be routed to X host on port 80. that's the way the tunnel works.. it's not aPythonimplementation, it's a tunnel implementation :) Whatever script/sql statement you run on the locally tunnelned port, will be routed to the defined host on the other end.