投稿

sshトンネルを使用してmysql-cliで接続する

sshトンネルを使用してmysql-cliで接続する

解決

$ ssh -N -L 13306:xxx-db-01.cluster-xxx.ap-northeast-1.rds.amazonaws.com:3306 user_name_for_ssh@connect_to_ip_via_ssh

$ mysql -u username  -p --port=13306 -h 127.0.0.1 database_name

参考

Connect to RDS using an SSH Tunnel - Michalis Antoniou - Medium

補足

Sequel Pro のSSHタブはどのように接続しているのか調べたら、SSHトンネルを利用していた。

You can use a SSH connection to circumvent some of the restrictions of standard conections. A SSH connection is actually not really a different kind of connection, but rather a standard connection made through a SSH tunnel.

Connect to a Remote MySQL Server

トレンドのタグ