mysql over ssh over non-standard port -



mysql over ssh over non-standard port -

i on computer a, , have mysql running on it, , can connect a~ $ mysql -u punkish -p database , on.

i have access computer b has mysql running on it. can ssh b on port 2200 ssh key pairs set up, , 1 time in, can connect db so

a~ $ ssh -p 2200 punkish@b b~ $ mysql -u punkish -p database

however, want set port forwarding on ssh on computer requests made mysql on port 3307 on computer sent port 3306 on b. allow me utilize gui programme wants connect mysql, can't on tunnel. so, next

a~ $ ssh -p 2200 -l 3307:b:3306 punkish@b b~ $

the above logs me right b. not sure if tunnel established, assuming is. however, next fails (in terminal

a~ $ mysql -p 3307 -u punkish -p come in password: error 1045 (28000): access denied user 'punkish'@'localhost' (using password: yes)

here interesting thing -- have gui programme called sequel pro (a desktop mysql client mac os x), , able create connection mysql@b on ssh fine. so, know works... don't know how, may able enable gui program.

mysql attempts utilize socket file if don't specify hostname. part of mysql command, specify -h 127.0.0.1 (notice did not localhost, treats them differently). forces tcp connection instead of socket file connection.

mysql ssh ssh-tunnel

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -