Krijk
March 10th, 2010, 01:02 PM
I'm trying to connect to a remote MySQL server over a SSH tunnel. I want to create a permanent tunnel. I created the tunnel (with key-authentication) using:
ssh -f -L 3307:localhost:3306 user@www.myserver.com -N
netstat -lpd says it is listening:
tcp 0 0 localhost:3307 *:* LISTEN -
When I try to connect to MySQL (on the remote server) with a Python-script I keep getting connection errors.
OperationalError: (OperationalError) (1045, "Access denied for user 'dbuser'@'localhost' (using password: YES)") None None
The dbuser has 'dbuser'@'%' rights on the database and I can logon from the remote server. When I try connecting to a local database (on port 3306) the script works fine, so it is obviously an SSH tunnel configuration error.
I've fiddled with it for some time, but I'm not getting anywhere. Any suggestions?
ssh -f -L 3307:localhost:3306 user@www.myserver.com -N
netstat -lpd says it is listening:
tcp 0 0 localhost:3307 *:* LISTEN -
When I try to connect to MySQL (on the remote server) with a Python-script I keep getting connection errors.
OperationalError: (OperationalError) (1045, "Access denied for user 'dbuser'@'localhost' (using password: YES)") None None
The dbuser has 'dbuser'@'%' rights on the database and I can logon from the remote server. When I try connecting to a local database (on port 3306) the script works fine, so it is obviously an SSH tunnel configuration error.
I've fiddled with it for some time, but I'm not getting anywhere. Any suggestions?