Skip to content

Commit 58988a6

Browse files
authored
Create remote_db_connection.md
1 parent 6ee9e4e commit 58988a6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

sphinx/aws/remote_db_connection.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Setup remote database connection to local mysql workbench
2+
3+
Help clients setup remote database connection to local mysql workbench with an ssh tunnel. There are slightly different parameters for Mac and Windows machines. This is because the parameters have changed slightly since moving from digital ocean to aws.
4+
5+
The port forwarding command that needs to be used is
6+
`ssh -L 3308:<db_host_ip>:3306 <linux_username>@na-db-1.specifycloud.org -i <path_to_ssh_key>`
7+
8+
Then test the connect by running:
9+
`mysql -h 127.0.0.1 -P 3308 -u<db_username> -p'<db_password>' <database_name>`
10+
11+
MySQL Workbench Parameter example:
12+
13+
DB params:
14+
server host: <db_host_ip>
15+
port: 3306
16+
username: master
17+
password: <db_master_password>
18+
ssh tunnel params:
19+
host: na-db-1.specifycloud.org
20+
user name: ubuntu
21+
private key: /Users/me/specify/keys/specify_ssh_key
22+
23+
Mac/Windows example:
24+
25+
mac/linux: `ssh -L 3307:<db_host_ip>:3306 <linux_username>@il-specify7-1.specifycloud.org -i ~/specify_key`
26+
27+
Windows PuTTY: `C:\Program Files\PuTTY\putty.exe" -ssh -i c:\users\user_name\private_key_specify_cloud.ppk <linux_username>@il-specify7-1.specifycloud.org -L 3307:<db_host_ip>:3306 -N`
28+
29+
`C:\Program Files\PuTTY\putty.exe" -ssh -i c:\users\<user_name>\private_key_specify_cloud.ppk <linux_username>@eu-db-1.specifycloud.org -L 3307:<db_host_ip>:3306 -N`
30+
31+
Here is the command for windows for a remote sqldump: (run in command prompt) or use PuTTY
32+
`plink -ssh -i "C:\path\to\your_private_key.ppk" <llinux_username>@eu-db-1.specifycloud.org "mysqldump --max-allowed-packet=2G --single-transaction -h <db_host_ip> -P 3306 -umaster' --databases <database_name>`

0 commit comments

Comments
 (0)