I am trying to create a local development environment using MAMP that's connected to a remote MySQL database using Sequel Pro. I am connected to the remote database via an SSH connection in Sequel Pro. From what I understand I need to do some kind of port forwarding from so that when MAMP hits 127.0.0.1 it forwards to the remote server connection. I found a resource that said I need to change the bind-address my.cnf file in MAMP, but it doesn't appear like MAMP has one. Another resource said I can copy another .cnf file, but I'm not entirely sure where to copy this file so that it affects MAMP and it doesn't seem like any of the other .cnf files have bind-address in them. Looking for some help here because I am totally stuck. I am using MAMP 3.0.3 if that helps at all.
Asked
Active
Viewed 2,602 times
1
-
You can use the -h (host) option and pass the url/ip of your remote-server when you connect with mysql from your local machine. – rb512 Apr 07 '14 at 02:55
-
how do I do that? within phpmyadmin once I get MAMP running? – bruce_e_kinesis Apr 08 '14 at 16:01
-
You can configure server settings in phpmyadmin and add the host. How do you connect to mysql? – rb512 Apr 08 '14 at 18:11
1 Answers
1
If you have an entry in your ~/.ssh/config
describing how to connect to your remote server… something like:
Host remote_server
Hostname 81.2.92.12
User theuser
IdentityFile ~/.ssh/id_rsa
you can forward remote_server's port 3306 to your local port 3307 like so:
ssh -N remote_server -L 3307:localhost:3306
And yes, you could forward remote 3306 to your local 3306 if you prefer. I chose 3307 because it's less likely to be in use.
The other thing you could do is skip the middle-man. Instead of forwarding the port, you can rely on Sequel Pro's built-in SSH support:
You don't have to specify SSH password. In fact: I found that I didn't even have to specify SSH user. The only part that's really important is "SSH Host'; it can use this to lookup the entry in your ~/.ssh/config
.

Birchlabs
- 7,437
- 5
- 35
- 54