I know this is a duplicate question, but I’ve tried many resources and none of them worked for me. My company has an Amazon Bastian Server that I SSH into. From there, I can SSH into various IP addresses to administer databases. I want these databases to be available in phpmyadmin. Here’s as far as I’ve gotten:<ol><li>
SSH into the main Amazon server via putty. Using a tunnel for port 3307, when I visit localhost:3307, I get a message “Welcome to nginx!”. I assume that means I’m connected to Amazon.</li> <li>
I tried the additional host configuration instructions here: <a href="http://shallop.com/2011/04/howto-use-phpmyadmin-to-remote-admin-mysql-dbs-via-ssh-tunnel/" rel="nofollow">http://shallop.com/2011/04/howto-use-phpmyadmin-to-remote-admin-mysql-dbs-via-ssh-tunnel/</a></li> </ol>
When I restart phpmyadmin and try my new connection string, it just hangs. Where am I going wrong here?Answer1:
There are a few bits of info missing from your question, so I'll make some assumptions:<ul><li>You are running phpmyadmin on a local webserver</li> <li>You want to create the tunnel on this machine to connect to a remote mysql server which is only accessible through your Amazon Bastian Server</li> </ul>
Well then it should be all down to how you set up the port forward, as your getting Welcome to nginx! it sounds like you have forwarded port 3307 to port 80 on the remote machine.
Try this ssh command:
$ ssh -N <username>@<Bastian server IP> -L 3307:<internal ip of mysql server>:3306<ul><li>-N means you don't want to execute any commands (just port forward)</li> <li>3307 is the local port to be forwarded</li> <li> is the IP that the Bastian server can use to connect to the MySQL server</li> <li>3306 is the port MySQL is running on the remote machine</li> </ul>
Now running the following on your local machine:
$ telnet localhost 3307
You should see you mysql version number outputted, some random characters and then mysql_native_password, the connection will then close.
you should then be able to configure phpmyadmin to use localhost and port 3307 to connect to your remote server.