

This will present the local end of the tunnel on your computer on port 3333 instead. You can rate examples to help us improve the quality of examples. These are the top rated real world Python examples of sshtunnel.SSHTunnelForwarder extracted from open source projects.

Works like charm! import nnectorĬonfig.read('c:/work/tmf/data_model/tools/config.ini') ssh -p 722 -N -L 3333:localhost:3306 userservername. Python SSHTunnelForwarder - 58 examples found. Ssh_pkey='/home/userName/.ssh/id_ed25519',Ĭnx = (user='sql_username',Ĭursor.execute('SELECT * FROM db_name.tableName ')īest practice is to parameterize the connection variables. With sshtunnel.SSHTunnelForwarder(ssh_address_or_host='ssh_host', In case of an error on SQL server side, you do not receive an error message from SQL-server. If you indent the last two lines in your script, it should work. Step 1: Setup SSH Tunneling Create a user and assign a password. This is the last release of pgAdmin that will support Python 3.6 and. I think the problem is that you're trying to access the database from outside the with block - this means that the SSH tunnel has already been shut down when you do the pd.readsql. If you use nnector from Oracle you must use a constructionĬnx = (.Īlso, your SQL statement must be ideal. Ensure that SSH Tunnel should work properly after upgrading to 7.2 from 7.1. You may only write the path to the private key file: ssh_pkey='/home/userName/.ssh/id_ed25519' (documentation is here: ).
