![]() ![]() adding host='localhost' or host='127.0.0.1' to the parameters for the "cnx" object produces the exact same error.User privileges for the user on the database have been confirmed as GRANT ALL.I tried passing the password string as a raw string, to see if somehow the Python string syntax wasn’t being received by the MySQL db correctly, and still received the same error.This Plone tutorial teaches you how to connect to localhost:3306 with MySQL Query Browser by building SSH. I have already confirmed my user and password are valid. How to Connect to MySQL via SSH Tunnel in Windows.If you indent the last two lines in your script, it should work. ![]() Create a new connection by clicking the icon next to MySQL Connections in the main window. erauth_publickey_fromfile(user, r'C:\Users\user\Docs\ssh-key')Ĭnx = (user='username', password='$gHj1aFaVFRfhl*C', database='analyst_db')įile “C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site- packages\mysql\connector\connection.py”, line 176, in _auth_switch_request raise errors.get_exception(packet) : 1045 (28000): Access denied for user (using password: YES) Step 1: Setup SSH Tunneling Create a user and assign a password. 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. Once you’ve installed MySQL Workbench on your computer, launch the program. Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) The tunnel will be instigated by the client. Let’s use the standard port for SSH (i.e., port 22). Here is what I’ve written so far: import socket The first step is to open the firewall for SSH communications between the systems. I am trying to write a script that connects to a server, then connects to a MySQL db (which I currently can do via Navicat - so I know my username and password for the MySQL connection are correct). ![]()
0 Comments
Leave a Reply. |