

Pass # This is very dodgy but the multi=True doesn't work
#PYTHON MYSQL SSH TUNNEL INSTALL#
sudo apt-get install python-mysqldb how would we find the name of the package. So here is my hack solution which works? sqlfile = open('someimport.sql', mode="rb")Įxcept : python sshtunnel pip install paramiko sshtunnel MySQL-python code import sshtunnel import MySQLdb REMOTE. SSH tunnel: specify use SSH tunnel, hostname yourserver, port 22. Mainly I’ve found if you’re reading from a file you need to load the file outside of the ssh tunnel, Also when using the cursor, using multi=true will not import your data and will result in an Interface error. The Secure Shell forwarding, or SSH, can be used for data forwarding.

But there is some limitation, the mysql connector doesn’t work as expected in this configuration (I’m using python 3.5.2, mysql-connector-python 8.0.21 and sshtunnel 0.1.5). There is one more way to tunnel network traffic. I deleted my comment yesterday because I needed to test this solution some more, but I’ve found that enabling the use_pure option on the mysql connector will get it to work.
