5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sequel ProでSSH Over Session Managerを使った踏み台サーバーのDBに接続する

Posted at

結論

Sequel ProではユーザーのPATHを参照してくれないようなので、
brewなどでaws cliをインストールした場合、ssh_configでPATHを明示的に追加する必要があります

ssh config を準備

Host AWSEC2
  HostName i-x0x0x0xx0x0x0
  User ec2-user
  IdentityFile ~/.ssh/id_ed25519
  ProxyCommand sh -c "PATH=$PATH:/usr/local/bin/ && aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"

Sequel Proに設定

SSHホスト名の欄にssh configのHostに設定した名前を入力します
SSHユーザ、SSH鍵などはssh configで設定してあるので、空欄のままで大丈夫です
image.png

MySQLへの接続情報はshellでsshしたあとに叩くmysqlコマンドを確認して入力します

mysql -h <MySQLホスト> -u<ユーザ名> -p<パスワード> <データベース>
5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?