0
0

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 1 year has passed since last update.

Vagrant上のPosgreSQLに接続する

Posted at

Vagrantで5432ポートをlocalhostの5432にマッピングしているにも関わらず、Vagrantホストから直接接続できませんでした。

なのでvagrantへssh tunnelして、接続することにしました。

以下のコマンドでVagrantへのssh接続情報を確認できます。

$ vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /PATH_TO/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

tunnelに必要な情報は、HostName,User,Port, private_keyへのパスでした。

参考
https://stackoverflow.com/questions/30823844/connect-to-mysql-database-on-vagrant-machine-in-phpstorm/43546183

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?