Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'sql_user_name'@'172.45.678.910' (using password: YES)
- import mysql.connector
- import sshtunnel
- with sshtunnel.SSHTunnelForwarder(
- (ssh_host,ssh_port),
- ssh_username = ssh_username,
- ssh_pkey = ssh_pkey_path,
- remote_bind_address=(sql_host, sql_port),
- local_bind_address=("127.0.0.1",8080)) as server:
- mydb = mysql.connector.connect(host=sql_host,user=sql_user_name,password=sql_pwd,db=db_name)
- myCursor = mydb.cursor()
Add Comment
Please, Sign In to add comment