> 데이터 베이스 > MySQL 튜토리얼 > Remote Access to Your MySql and PostgreSql Databases_MySQL

Remote Access to Your MySql and PostgreSql Databases_MySQL

WBOY
풀어 주다: 2016-05-31 08:46:13
원래의
968명이 탐색했습니다.

I’m setting up a new Linode Cloud Server and it’s been awesome so far. I installed both MySql and PostgreSql on it, so I’m good to go. I spend a lot of my development time in the database and I want to have my full range of expression with my databases in the cloud. I may be a fan of both the mysql and postgresql command prompts, but I want to work in a nice IDE like Navicat when I can.

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.

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿