How to Connect to Vagrant DB
I have successfully setup a working PyCharm/Vagrant/Django environment on Mac OSX. However, I've got stuck on how best to connect to the Postgresql database on the Vagrant machine for my Django project.
Obviously it needs to be done through the SSH Tunnel setting in the Remote Database options, but I can't get the various port/host configurations to work correctly.
Would love some pointers!
Obviously it needs to be done through the SSH Tunnel setting in the Remote Database options, but I can't get the various port/host configurations to work correctly.
Would love some pointers!
Please sign in to leave a comment.
http://forum.jetbrains.com/thread/PyCharm-1731
Here's the settings chain:
Suppose the original MySQL URL is jdbc:mysql://real-db-host:3305/db-name
and we want to setup SSH tunnel in the middle. The configuration is changed as follows (see screenshot):
1. SSH Tunnel dialog
SSH tunnel is created on localhost:537 to ssh-server:22 (authentication applied)
which in its turn will pass packets to real-db-host:3305
2. Datasource Properties dialog:
the original JDBC url has to be changed to jdbc:mysql://localhost:537/db-name