I am using windows 7 with Python 3.4 (with Pycharm) and try to acces a remote mySQL-database through SSH with a private key, just like it is working with MySQL-Workbench in the following picture : http://goo.gl/TgwdYI
I use SSHTunnel (https://goo.gl/pGfD30) to setup the SSH-Tunnel as follow :
from sshtunnel import SSHTunnelForwarder
server = SSHTunnelForwarder(
Which works smoothly.
Then I try to connect through the MySQL-connector for Python as follow :
cnx=mysql.connector.connect(user='yoann_builder', password='pass',host="127.0.0.1", port=3307)
And I got the following error :
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '127.0.0.1:3307' (10061 No connection could be made because the target machine actively refused it)
The problem is, to my understanding, "How to specify to the connector to use the SSH-Tunnel?"
Thanks in advance for your help.