我在公司,想用sqlyog远程连接机房中的mysql数据库主机A,但A是在内网中的,它没有公网ip,ip是192.168.x.x。而与A连接的是web服务器B,我能登陆B,再ssh登陆到A,但这样只是命令行界面。我想,sqlyog能否通过B再连接到A呢?
  如果可以,应该怎么设置?

解决方案 »

  1.   

    没有办法,因为在网络层就是不通的。
    除非你在 B 上安装 sylyog, 并且你能通过什么工具比如 (remote desktop)之类的连上去它的图型界面。
      

  2.   

    搞定了。sqlyog的帮助文档有说。
    To understand the setup better, let us connect to a MySQL server using a real life example.E.g. Your website is hosted on 234.56.65.78. This server also has SSH server running and listening on port 22. Your MySQL server is located on server 234.56.65.79. This machine only allows connection from localhost or machine within the same network (e.g. 234.56.65.78). You publish your website on 234.56.65.78 using the username and password provided by your ISP. Ex. the username and password provided is ssh_user and ssh_pwd respectively.In this particular case you have to put in the following value for various options:Server Tab  
    MySQL Host Address localhost 
    Username  Your mysql user name.
     
    Password 
     Your mysql password. 
     
    Database 
     The database that you want to connect to. You can leave this field blank. 
     
    Port 
     The port MySQL is listening. By default it is 3306. 
     
    Tunnel Tab  
    Username 
     ssh_user 
     
    Password ssh_pwd 
    SSH Host 234.56.65.78 
    SSH Port 22 
    Local Port Any port that is unused on your local machine. If you don't have a MySQL running on your machine then you can provide 3306.