Connect to a remote MySQL DB without changing access grants (ssh required)
Many developers like to use phpmyadmin to administrate their database. But sometimes you wanna use our local SQL editor to fire up some statements or check / document the structure of a database via MySQL Workbench. The Problem is, that many servers are resticted to the local connection and maybe you will not change these restictions.
If you have ssh access than this is not a problem. You can tunnel easily the connection via ssh
.
ssh -C -N user@remoteserver -L 3307:127.0.0.1:3306
this call will tunnel the local port 3307
to the mysql port 3306
on the remote server.
You can now connect to your localhost
with port 3307
to get access to the remote MySQL Database with your local SQL Editor / Application.
Written by Thomas Pannek
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#