[email protected] | 3F Hanston Bldg., Ortigas Center, Pasig City | +632 8876-1925 |
| | |
iManila Help Center

Category: DATABASES

cPanel – MySQL Databases

MySQL is the most popular Open Source SQL Database management system. To manage a huge volume of data efficiently, we store the data in tables, a group of many tables can be created in a single database. This interface allows you to create and manage the existing MySQL databases.

If you are creating a PHP based application or any application that uses a database, then you will need to create a database and a database user to access this database. To use WordPress, Drupal, Joomla or any other CMS, you will need to create a MySQL database before installing these CMS.

To create a new MySQL database, you need to open MySQL interface by clicking MySQL Databases link, which can be found in the Databases section of cPanel Home.

Create a New Database

When MySQL Databases interface will open, first thing you will see is Create New Database Section as shown below.

To create a database, simply enter the name of the database you wish to create and then click Create Database Button. You will now get a success message that the database is added.

Note − cPanel will automatically add a prefix to your database name you enter. So that there is no ambiguity in databases as in shared hosting environment. There are many users and there cannot be same name for two databases, thus your database name become Prefix_dbName. When connecting the database with web application you will need to use Full Name of database.

Add a Database User

To use your newly created database in your application, you will need to create a user and grant it all the privileges to modify the data in Database.

To create a Database User, scroll down to the end in Interface of MySQL databases. There you will see MySQL users, under it there will be Add New User, as shown below.

Step 1 − Enter a username according to your choice and choose a strong password. Click Create User to create a new user. You will get a success message “You have successfully created a MySQL user.

Note − Full username of your database user includes prefix and the username you provided.

As we have created a database user, now we will need to add the user to access the database.

Step 2 − Scroll down to find “Add User to Database”.

Step 3 − Select the User and database you wish to associate together. Click Add button and you will see the following screen.

To provide all the privileges to the user, select ALL PRIVILEGES checkbox and all the checkboxes will automatically get selected. Click Make Changes to save the changes.

Modifying a Database

The data stored in MySQL may get corrupted over time. There are many reasons for which this might happen. While using the Database in web application, if we see any database related error, we need to repair the database to repair the corrupt data. But before we repair our database, we will need to find the table on which our data is corrupted by checking the database for errors.

There are two operations we can perform to troubleshoot database related errors. To perform these actions, we need to scroll to Modify Database Options in MySQL Database Interface, screenshot for Modifying Database is shown below.

Check a Database

With this feature of cPanel Database, you can find which table in the Database is corrupted.

To check a database, we need to perform the following steps.

Step 1 − Select the database you want to check, from the dropdown menu of Check Database, as shown above.

Step 2 − Click the Check Database button.

Step 3 − cPanel will now run an automated script to find the corrupt table in the Database. If any corrupt table is found, it will display the name of the Table, otherwise it will display a success message.

Repair a Database

This database tool helps in automatically repairing of corrupt data or table from the database.

To use this tool, we need to perform the following steps −

Step 1 − Select the database having corrupt data from the dropdown menu.

Step 2 − Click Repair Database button.

Step 3 − cPanel will now run an automatic script to repair the corrupt data or table from the database, if it succeeds, it will give you a success message. If it fails to repair the database, it will show you an error with the table name on which the error occurred.

 

cPanel – MySQL Database Wizard

MySQL Database Wizard is a step by step process to create a MySQL database and user and finally adding the user to access the database.

To use this interface, we will need to open MySQL Database Wizard, which can be found in the database section of cPanel Home, as shown below.

Step 1 − Create a New Database by providing a Database Name in the text input, once filled, click Next Step.

Step 2 − Create Database user by providing a username and Password. Click Create User when done.

Step 3 − Add user to the database by granting all the privileges to the user for accessing and modifying the data. Select ALL PRIVILEGES checkbox and click Next Step, when done.

Step 4 − You will get a success message if everything works fine.

To modify the database created using MySQL Database Wizard, you can always use MySQL Databases interface.

 

cPanel – phpMyAdmin

The phpMyAdmin is a third-party tool to manage tables and data inside a database. It is graphical user interface to manage MySQL databases. You can manually create Tables, Import and Export data or edit the values of a row through it.

To access phpMyAdmin, click on the phpMyAdmin link, which can be found under the databases section of cPanel Home.

You will see a dashboard similar to this.

On the left hand pane, there is a list of databases, which can be expended to see the table in each database. On the right hand pane, there is general information of Database server.

Execute an SQL Query

To execute an SQL Query on a database, we will need to perform the following steps −

Step 1 − Select the database from left pane by clicking over the name of the database. Once the database is selected, it will show you the structure of the database.

Step 2 − Click on SQL from top bar to open SQL editor.

Step 3 − Write your query into the SQL editor. You can also enter multiple queries, separated by semicolon (;).

Step 4 − Click Go button to execute the query. If the query is executed successfully, you will get a success message.

 

cPanel – Remote MySQL

This feature of cPanel allows remote servers or web application to access a database hosted on your account. If a server or web application tries to access the database on your account, which is not provided access to, then cPanel will not allow this host to access your database. But, if you have an application, whom you wish to grant access to your databases, you can add their host names or IP address here.

To access this interface, click on Remote MySQL link found in your Database Section of your cPanel.

Add Access Host

To Add Access Host, which can access your databases when needed. You will have to enter Host Name in text input. You can enter hostnames in three types.

  • You can use Domain Name, E.g. www.domain.com
  • You can use IP address, E.g. 184.168.144.133
  • You can use wildcard %, E.g. %.domain.com or 184.164.144.%

Click on Add Host to add an access host.

Remove Access Host

To deny access to a web application having access to the databases, click the Delete link from the list of Access host.

 

Let's work together!


Make the first move! Let iManila help you maximize your presence online.

Just fill out your contact details and tell us what you need, then we’ll be sure to get back to you as soon as possible.