Menu

Connecting to a remote database

Help
3×5
2015-07-14
2015-07-14
  • 3×5

    3×5 - 2015-07-14

    Hello, I am having trouble connecting to my database, but I have also noticed that all the examples in the documentation point to localhost. I need to be able to connect to a remote database over ssh.

    I think I have done everything else correctly. I see that there is a place to input a user name and password, but these are the mysql credentials. I don't see where to put in my ssh credentials. Thanks.

     
  • John Spackman

    John Spackman - 2015-07-14

    If the server is not on your local network you can create a tunnel to a remote server over SSH which makes the remote database server appear as though it was running on your localhost:

    ssh username@remotehostname -L port:remotehostname:port -N

    where "port" is the TCP port, eg for MySQL that would be 3306:

    ssh 3x5@www.myserver.com -L 3306:www.myserver.com:3306 -N

     

Log in to post a comment.