MySQL connection over SSH

chrismeek4542 at gmail.com chrismeek4542 at gmail.com
Tue May 12 09:41:44 EDT 2015


I am trying to connect to a remote MySQL Database over SSH. I am using paramiko and SQLAlchemy. I assume that my sqlalchemy engine is not going through the SSH tunnel. Here is what i have so far. Not sure where to go from here though.

import paramiko
from sqlalchemy import create_engine

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('host.com', port=port, username='usr', password='pass')

engine = create_engine('mysql+mysqldb://pass@host.com:3306/db')

I am getting this error:




More information about the Python-list mailing list