1. Home
  2. Hosting
  3. How to connect to the MySQL server

How to connect to the MySQL server

This guide explains what settings to use to connect to the MySQL server. 

MySQL is a popular relational database management system used in various applications and web services. However, on cPanel shared servers, the MySQL port 3306 is locked down to local access only, which means that connecting to the MySQL server from remote locations is not straightforward. 

This article will provide you with the necessary information to establish a local MySQL connection.

 

MySQL port 3306 is locked down (local access only) on all our cPanel shared servers. This will effectively mean that customers can’t access MySQL with tools like MySQL Workbench/Heidi SQL from a remote locations.

 

Why: 

  • Due to the ever increasing vulnerabilities and the risk attached to these have decided to lock down MySQL to local access only.

 

Setting up a local MySQL connection via script van be done as per below:

 

Configuration Settings:
Host = localhost (really, put localhost)
Database name = (cpanelusername_databasename)
Database username = (cpanelusername_databaseusername)
Database password = (******) 

 

 

INFO:When you move databases to our servers, the database name and username may change. This change must be updated in your script code. (The database name and username is clearly displayed in cPanel, in the MySQL area.) 

 

Updated on November 14, 2023

Was this article helpful?

Related Articles