Good content takes time and effort to come up with.

Please consider supporting us by just disabling your AD BLOCKER and reloading this page again.







How To Securely Connect Server MYSQL DB From Sequel Pro / MYSQL Workbench


MYSQL CLIENT SSH KEYS SSH MYSQL SEQUEL PRO MAMP SECURITY MYSQL WORKBENCH
21st April 2020 3 mins read
Share Article     Share On WhatsApp   Buy Me Coffee | StackCoder Buy Coffee


Prerequisites


I hope you guys have setup remote server connection from computer / laptop with SSH connection. If you want to learn more on setting up SSH connections then go through my articles

How To Generate SSH Key with ssh-keygen In Linux / Unix

Managing Multiple GIT Key Pairs Or Account In The Same Computer


And I believe that you have Sequel Pro / MYSQL Workbench or similar software with SSH connectivity feature. If not then download form the following URL's

Sequel Pro - Download SequelPro

MYSQL Workbench - Download MySQL Workbench


Step 1 - Open your MYSQL Client


I will give demo with Sequel Pro MYSQL Client. The process will remain same across multiple softwares.


For the first time when you open your SSH client you will see it like the following image


Default Sequel Pro Quick Connect -> SSH

Default Sequel Pro Quick Connect -> SSH



QUICK CONNECT ->SSH

NAME - StackCoder

You project name or anything by which you can easily identify when you open you client


MYSQL HOST - 127.0.0.1

Since you want a secure connection no need to give BIND IP-ADDRESS or no need to create new user in you server mysql and grant him admin privileges.


USERNAME - testinguser

This is your server MYSQL database username. For the sake of demo I have written as testinguser.


PASSWORD - ******

You remote server MYSQL database password. This is the one which will be create while creating the database. Add your password


DATABASE (OPTIONAL) - [I have left empty]

If you have one 1 database and want to connect it by default then add the name of your database. Else don't fill so that you can connect to any database you need in later part.


PORT (OPTIONAL) - [3306]

Your default port is 3306, since mine too is 3306 so no need to add it, if you have setup the MYSQL in your remote server on any other port then better change this


SSH HOST - stackcoder.in

Your remote server domain name or ip address anything is fine.


SSH USER - stackcoder

I have secured my server with some simple security and have disabled root user access because of security concerns. But you can use root user.

Just in case if you really want to look into this and want to secure your server then you can follow my another article on it How To Do Basic Server Security Setup For Ubuntu / Linux.


SSH PASSWORD - id_rsa.pub / id_rsa file

As I had said earlier too that having your SSH password is very bad idea. So first test with id_rsa.pub file if you face any issues then try with id_rsa file.

These files usually resides in ~/.ssh/ folder


SSH PORT (OPTIONAL) - [22]

No need to add unless you have change in your server.


Now once you fill all your details then you will be able to see it like the following


Sequel Pro SSH Fields Filled

Sequel Pro SSH Fields Filled



Step 2 - Test Connection & Save Connect For Future Use


Once you follow the above steps you will get simply connected. But instead of clicking Connect, click on Test Connection. If it succeeds the click on Add To Favourites so that it will save in you left sidebar for future connections very easily.


Conclusion


Now you know how to connect securely to your remote server make sure to check out my other articles for securing your server


How To Do Basic Server Security Setup For Ubuntu / Linux

How To Install Linux, NGINX, MYSQL, PHP (LEMP Stack) on Ubuntu

How To Install Linux, Apache, MYSQL, PHP (LAMP Stack) on Ubuntu


Hope it helped you. Happy Coding :)











Author Image
AUTHOR

Channaveer Hakari

I am a full-stack developer working at WifiDabba India Pvt Ltd. I started this blog so that I can share my knowledge and enhance my skills with constant learning.

Never stop learning. If you stop learning, you stop growing