Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Connecting To A Local Database On A Remote Machine

DZone's Guide to

Connecting To A Local Database On A Remote Machine

·
Free Resource
I had a MySQL instance on a remote server that had only local access. I wanted to connect to that database via my local copy of CocoaMysql. Using ssh portforwarding you can  do it like this: 


ssh -N -L 
  
   :127.0.0.1:3306 remote_machine

  

so you can now open CocoaMysql and connect to localhost, bla, bla but if you use the 
 
   assigned above you should see your remote database.
 
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}