MySQL connection over SSH tunnel - how to specify other MySQL server?

前端 未结 4 1582
日久生厌
日久生厌 2020-11-28 02:54

I\'ve got ~50 databases all set up at different host names, with the requirement that I connect to them through an SSH tunnel.

For example:

  • SSH ho

4条回答
  •  时光说笑
    2020-11-28 03:23

    I created a tunnelto the DB using this command

    ssh  -L 10000:localhost:3306  user@ -N -f
    

    -L is local host port it is user defined u can provide any port number

    between 0 to 65535. 0 to 1023 are reserved.

    whether you are using key based authentication to the server you should

    mention the key like this.

    ssh -i   -L 10000:localhost:3306  user@ -N -f
    

提交回复
热议问题