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

Connect to MySQL via SSH

DZone's Guide to

Connect to MySQL via SSH

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

I use the excellent HeidiSQL as a GUI when working with MySQL.

I've recently set up a new server and knew that HeidiSQL has support for connecting via an SSH tunnel. As a note to myself, these are the settings:

Settings tab:

Network type: MySQL (SSH tunnel)
Hostname / IP: locahost
User: mysqlusername
Password: mysqluserpassword

SSH tunnel tab:

plink.exe location: c:\somedir\plink.exe
SSH Host: my.server.com
SSH port: 22
Username: mysshuser
Password: mysshpassword

The key thing to note is that on the settings tab you need to enter localhost and the username and password of the MySQL user. This is because HeidiSQL connects to MySQL once you're connected via an SSH login.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:

Published at DZone with permission of John Whish, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}