37609

SSH Tunnel Via PhpMyAdmin [closed]

Question:

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.

Recommend

  • Stale-while-revalidate cache replacement from Varnish
  • Deployment Rails app for Docker
  • How to exit “docker run” containers once the script those containers execute calls exit()
  • Bloomberg Data… Why doesn't Application.WorksheetFunction.BDH work?
  • Apache POI 3.17 in OSGi
  • Position Userform differently for each ActiveCell Clicked
  • How to debug office add-in for mac?
  • Can't configure nginx as a proxy for tomcat with context path
  • Android NFC read Tags issue. Activity starts each time on data received
  • openssl handshake failed
  • How to resolve docker host names (/etc/hosts) in containers
  • Receiver has no segue with identifier“***”
  • CORS with socket.io
  • ckeditor and jquery UI dialog not working
  • mave 3.2 not able to access local nexus instance return 502 code
  • Most efficient way to move table rows from one table to another
  • New Firebase failed: First argument must be a valid firebase URL and the path can't contain “.”
  • cordova is not defined - cordova.js has already been loaded :: Ionic
  • jQuery: add elements until a particular height is reached
  • Tomcat memory Leak
  • Combining two different ActiveRecord collections into one
  • Spring Cloud Microservice Architecture Confusion
  • How does document.ready work with angular element directives?
  • Retrieve list of sent friend requests from friend_request FQL table
  • How to use carriage return with multiple line?
  • Cannot resolve symbol 'MyApi'
  • Avoid links criss cross / overlap in d3.js using force layout
  • NHibernate Validation Localization with S#arp Architecture
  • Recording logins for password protected directories
  • Lost migrations and Azure database is now out of sync
  • How can I send an e-mail from a vbs script
  • Accessing IRQ description array within a module and displaying action names
  • Does CUDA 5 support STL or THRUST inside the device code?
  • When should I choose bucket sort over other sorting algorithms?
  • How do you troubleshoot character encoding problems?
  • Is there a mandatory requirement to switch app.yaml?
  • Understanding cpu registers
  • Getting Messege Twice Using IMvxMessenger
  • need help with bizarre java.net.HttpURLConnection behavior
  • UserPrincipal.Current returns apppool on IIS