SQLAlchemy through Paramiko SSH
问题 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. 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() Is there a way to do this