There, isn’t that sweet? I can work with both my Linode PostgreSql and MySql databases in Navicat as if they were on my hard drive.
We’re going to connect to the Linode PostgreSql and MySql ports through an SSH Tunnel. And it’s all done through a single command.
$ ssh -L 127.0.0.1:3307:127.0.0.1:3306 user@example.com -N
The first port is 3307. That’s what most developers will use because we have MySql running locally. Otherwise if you did not have MySql running locally you would use the default MySql port of 3306. Change “user@example.com” with your SSH username and your server’s hostname or IP address. Don’t make this hard like I did. There’s no need to change your local or remote MySql port settings in /etc/mysql/my.cnf. Once you’ve setup SSH to access your Linode server the above command is all you need.
When you execute the ssh statement above, your prompt will just sit there. That means the connection is open and you’re good to go.
Then in Navicat (or your database IDE of choice) you simply connect to port 3307 for the Linode MySql database. You can ignore the SSH tab. Completing the General tab form is all you need.
Hopefully this will help you enjoy working in your Linode databases more than with a command line alone.
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com