title: SQLAlchemy through Paramiko SSH
body: <p>I have a database on a server which I need to access through SSH. Right now I deal with the DB by using the command line to get the data.</p>
  
  <pre><code>import paramiko
  ssh = paramiko.SSHClient()
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  ssh.connect(hostname='XX.XX.XX', username='user', password='pass', port = YYY)
  query = "mysql -u " + username_sql + " -p" + password_sql +" dbb -e \"" + sql_query + "\""
  ssh.exec_command(query.decode('string_escape'))
  ssh.close()
  </code></pre>
  
  <p>Is there a way to do this with SQLAlchemy to be more efficient and so I can work with pandas DataFrames directly?</p>
  
  <pre><code>from sqlalchemy import create_engine
  engine = create_engine(
         "mysql://username_sql:password_sql@localhost/dbb")
  </code></pre>