BuycPanel Blog

BuycPanel Blog

Latest news and updates

11/05/2014 – Connecting to the MySQL Database

Posted by Jamison on 05 11 2014.

Convenience, functionality, and efficiency—cPanel is known to top all of these aspects as more and more entrepreneurs have chosen to work with this hosting provider.  You can maximize the potential of your website or blog with cPanel if you know the basic and advanced features and how to apply them in your own site. You will hear it straight from the industry players that cPanel offers the convenience and features of advanced technology without you having to experience difficulty in execution and learning the tools and apps.


Website management is not a very easy task—you need to learn the process, to spend time choosing which features can upgrade your site, to apply the tools that will best provide you with the best improvements, and to understand the whole background of the business. You need to be on top of this so you can ensure your company’s growth and expansion.


One of the advanced features of cPanel is that it allows you to manage your databases.The Databases section will allow you to create MySQL and PostgreSQL databases and users. Through this, you can get access to them and modify the databases you wish to change.


SQL (Structured Query Language) is an international standard in retrieving and querying information from databases, while PostgreSQL is an object-relational database management system.


MySQL is essentially an SQL server as it works by responding to requests for information that are written in SQL. You can choose from a great selection of programming languages if you want to communicate with MySQL. PHP is one of the most common languages being used. This is an open software and you can use it for free.


Connecting to your MysSQL database is easy. The MySQL database will need a script calling or querying the database for the information it stores. In order to do this, you must connect your script to the database with a configuration file. If you are not sure where your configuration file is, you can check the various scripts and their location.


Database driven scripts, such as WordPress, WHMCS and Joomla, will generally have a default configuration file ready for you to edit with the appropriate information. Here are examples of what this access information will look like.


  • Host Name. You need to input localhost.
  • Database Name. This includes you cpanelUsername_databaseName.
  • Database Username. This includes your cpanelUsername_databaseUsername.
  • Database Password. This is the password that you have set.


Remember that when you move databases to our servers, the database name and username may change. This change must be updated in your script code. You can find the database name and username in cPanel, in the MySQL area. While on shared servers, the database username cannot be changed to something without the cPanel username in it. This is to keep database names and usernames from conflicting with others on the server.


You can also access MySQL remotely and allowing remote MySQL connections is often done to enable a program on your personal computer to access a database on the server. You simply have to learn another set of configuration settings.