LoginSignup
2
1

More than 3 years have passed since last update.

PyCharmでSSHトンネル経由でDBに接続する

Posted at

PyCharm 2019.2で実行しているが、Jetbrains IDEにあるDatabaseを利用しているので、他のでも設定項目はほぼ同じだと思う。

設定を作成する

  1. C-S-a でActionsを開いて、Databaseと入力してDatabaseを開く。
  2. New -> Data Sourceから目的のDBの種類を選部。

するとこんな感じのウインドウが開く。
new data source

SSH/SSLの設定

設定イメージ
ssh/ssl

Proxy host: 単にSSH接続するホスト。
Local port: 入力しないと自動で振ってくれる。 他でもそのトンネルを利用したいのであれば値を入力する。
Auth type: 認証方法の選択。 OpenSSH config and authentication agent は良く分からん。

Generalの設定

設定イメージ
general

Host: SSHで接続しているサーバーから見たDBのホスト名。

必要なものが入力し終わったら、GeneralにあるTest Connectionを押して接続を確認する。

2
1
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
2
1