We have explained how to connect to MySQL Database Server remotely to work. Work can range from simple taking backup to intensive work. How to Connect to MySQL Database Server is asked in three cases –
- We are working with Cloud Database as a Service like that from Rackspace; example and full guide is written in Rackspace Cloud Database for WordPress guide
- We are working with MySQL Server running on Cloud Server; example situation if you Setup Separate Database Server on Rackspace Cloud
- We are working with MySQL Server running on a shared setup or traditional dedicated setup
How to Connect to MySQL Database Server Remotely
The situation for connecting with Cloud Database as a Service can differ, we have linked the previous guide for the basics. It is impossible for us to use, test all existing Cloud Database as a Service in this world, one need to read the service providers guide. This is a generalized, easy guide for the learners. Like, in our video guide on how to Install WordPress on Rackspace Cloud Server (Ubuntu 14 04), one user asked why we have not recommended to use PHPMyAdmin on production server in case of one server setup.
We have replied him, but the next question arrives – how we can manage MySQL Database Server then. Technically this is called Connecting to MySQL Database Server Remotely. For MySQL, there are lot of tools to use, some of the most commonly used are listed on official website of MySQL, MySQL Workbench is an example :
---
1 | http://dev.mysql.com/downloads/workbench/ |
If you are connecting from your own computer, you need a MySQL client, whatever it is – Navicat, phpMyAdmin, Workbench or Dreamweaver. Definitely we can work from SSH only for minimal works like taking backup or restoring backup.
For Rackspace Database as a Service, you need to access either via SSH-ing to a Cloud Server and then connecting to it via the Cloud Server or add a Load Balancer. Like we have written in How to Export WordPress MySQL Database on Rackspace Deployment, you can use quite easy commands to do basic works. Recently, there is introduction of a command line PHPMyAdmin like tool :
1 | https://github.com/AbhishekGhosh/phpmyadmin-cli |
In general,
Use the following configuration settings for connecting to your database:
Host name = (server IP address)
Database name = (normally name of the database)
Database username = (normally Username of the database)
Database password = (the password you entered for that database user)
MySQL Connection Port = 3306
TCP or UDP, either will work fine.