SSH tunneling using PuTTY and MySQL-Front
PuTTY setup
- Create session
- hostname: any pgrad or ugrad SIT server e.g. grey.ug.it.usyd.edu.au or simply mysql.it.usyd.edu.au
- NOTE - as mysql.it.usyd.edu.au is a pgrad server, ugrads should use a ugrad server in the hostname field otherwise nothing will work ;-)
- protocol:SSH
- Session name: mysql (e.g.)
- Connection->SSH->Tunnels
- Source Port: 13306 (本地端口:指定一个没有被占用的端口)
- Destination: mysql.it.usyd.edu.au:3306(远程机器上myql数据库所在服务器ip地址和端口,端口一般是3306)
- Source Port: 13306 (本地端口:指定一个没有被占用的端口)
- Remember to click the “Add” Button to add the forwarded port settings as given above.
- Click on Session again and save the “mysql” session
MySQL-Front Setup setup
- Install
- Click the Connection Button under the File Menu
- Hostname/IP should be localhost
- Enter the correct username, password
- The port is 13306 instead of the default 3306 shown
- Enter your database name
- Click save
Making a connection
- Start PuTTY and connect with the "mysql" session using your normal login and password - congratulations, you now have an encrypted tunnel(启动PuTTY,登陆中转机,注意登陆后不要关闭了)
- Start MySQL-Front and click the connection button under the File Menu(启动MySQL-Front 登陆,有个缺点貌似容易断)
- Click connect and you should be connected
- If you get a connection failed error message from MySQL-Front, recheck the settings in MySQL-Front
- If PuTTY cannot connect - recheck your settings and make sure there is no local firewall blocking SSH
- 整个过程通过跳板机,把本地设定的端口(localhost:13306)映射到远程机器的mysql数据库的3306端口,全程保持PuTTY连接不断开,本地mysql客户端工具连接localhost:13306实现对远程数据库的访问
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Support
转自:http://sydney.edu.au/engineering/it/~support/w/moin.cgi/MYSQL_2dSSH