Support
Web hosting

Managing MySQL databases in cPanel

cPanel - MySQL database managment

In Databases category of cPanel, you will find the next options:

  • MySQL Databases
  • MySQL Databases Wizard
  • phpMyAdmin


MySQL Databases

cPanel -  MySQL databases

Inside MySQL Databases option you can do the following actions

  1. Create new database
  2. Check and repair a database
    • Check database
    • Repair database
  3. Edit database
    • Search database
    • Modify user privileges on database
    • Delete database user
    • Rename database
    • Delete database
  4. Add MySQL user
  5. Add user in the database
  6. Modify settings for existing users
  7. Change password for a MySQL user
  8. Change username for a MySQL user
  9. Delete MySQL user


1. Create database

* Note: the maximum length of a database name is 64 characters. This length includes the prefix of the database and the underscore character “_”.

* To insert information in your database you will use the option phpMyAdmin.

To create a new database, follow these steps:

cPanel - create MySQL databases
  • Within New Database, type your database name. Remember that the name of your database cannot exceed 64 characters, including the prefix and the underscore "_".
  • Press Create Database. You should now see a window in this format:

    cPanel - result of the creation of a new MySQL database

For the purposes of this example, we have created a database with the name “example_example123”.

  • Press Go Back to return to the home page. Your base should now appear in the table Current Databases.


2. Check and repair a database

cPanel - check - repair MySQL databases


Check database

If you have problems with any of your databases in server, check for errors. To make a database check, follow these steps:

  • In menu Check a Database, select the database which you want to check. In our example we choose the database named “example_example123” that we created earlier.
  • Click the Check the database button.
  • cPanel will run a script to ensure that this database is functional. If it detects a problem, reports the table that is corrupted. Otherwise, it returns the message “Check Complete”, as you can see below:

    cPanel - complete MySQL database check


Repair a database

If one of your databases has corrupted, you will need to repair it. To do this, follow this steps:

  • In menu Repair a database, select the database that you need to repair. We selected our example database “example_example123”.
  • Press the Repair the database button.
  • cPanel will run a script and will try to repair automatically the database. After completing this process, you should see a window like this:

    cPanel - complete MySQL database check

* Note: this script will try to repair your database. The repair may not succeed. In this case cPanel try to find the source of the corrupted data.


3. Edit a database

cPanel - current MySQL databases

The table Current Databases contains a list of all your databases on the server. For each base, this table contains the following information

  • the database name
  • the database size
  • the users who have privileges to the database management

It also includes a column with all possible actions that can be done on this database, like the editing and the deleting of the database.


Search a database

To find a database in th table Current Databases, type the search criteria in the Search text box and click the Go button. The table should now show the results.


Modify user privileges on a database

To modify the user privileges on the database management, follow these steps:

  • Click the name of the user on the table row that corresponds to the database you want to modify the privileges. You will see the MySQL Account Maintenance window.

    cPanel - MySQL database user privileges

In our example we will modify the privileges for the user “example_exuser” that we created for th database “example_example123”.

  • Check the boxes corresponding to the rights you want to grant to this user uncheck the boxes corresponding to the rights you don't wish the user to have on the database.
  • Press Make Changes.


Delete a database user

To delete a user from the database, follow these steps:

  • In the Privileged Users list press the Χ icon near the user you want to delete. You will now see the following window:

    cPanel - revoke user previleges on MySQL database

  • If you are sure you want to delete this user from the database, press Revoke User Privileges. Otherwise press Cancel.


Rename a database

* Note: renaming a database is likely to cause problems. We recommend that before attempting to rename your MySQL database, first take a backup of it.

If you rename a database, the system will terminate all connections to it.

Then you must manually edit all configuration files and applications to use the new name.

It will take longer, for the system, to rename larger and more complex databases.

To rename a database follow these steps:

  • In the table Current Databases, on Actions collumn, press the Rename button.

    cPanel - rename MySQL database

    You will now see the following window:

    cPanel - new MySQL database name

    We renamed our example database from “example_example123” to “example_example456”.

  • Type the new name of your database New name and press the Proceed button.

How cPanel renames a database:

MySQL not inherently allows the renaming of a base. When cPanel “renames” a database, the system makes the following actions:

  • creates a new database
  • transfers the data from the old to the new database
  • recreates the correlations and the stored code to the new base
  • deletes the old base and the associations of it.


Delete a database

To delete a database, follow these steps:

  • In the Current Databases table, press the Delete button in the Actions collumn, which corresponds to the database you want to delete.

    cPanel - delete MySQL database

    You will now see a window like this:

    cPanel - delete MySQL database confirmation

  • If you are sure you want to permanently delete the database, pressDelete Database.


4. Add a MySQL user

After creating a database, you can add users to it and determine their privileges.

To create a new user account, follow these steps:

cPanel - add a MySQL user

  • Type a name for the new user on the Username fild.
  • Type a new password and type it again on the Password filds.

* The system ranks the password you will use with 0 to 100. 0 means that your password is weak, while 100 means that your password is strong. You can also use the Password Generator to create a strong password. Attention, your password can not contain more than 7 charachters.

  • Press Create User.


5. Add a user in the database

cPanel - user assignment on MySQL database

When you add a user in the database you must also choose what will be his privileges. The privileges state that the user can interact with the database. For example, determine whether the user can add or delete information.

To add a user to a database, follow these steps:

  • Select the user from the User menu.
  • Select the database to which he will has access from the Database menu.
  • Press Add. You will see the MySQL Account Maintenance window.

    cPanel - user privileges on a MySQL database

  • Select the boxes corresponding to the privileges you want to give to the user of this database.

    * if you want to give all the privileges, select only the ALL PRIVILEGES box.

  • Press Make Changes.


6. Modify settings for existing users

cPanel - settings for a MySQL user

The Current Users table contains a list of all the MySQL users in your account. Use the Actions you will find in this panel to change passwords and usernames or to delete users.


Change password for a MySQL user

To change a user password, follow this steps:

  • In Current Users table, press the Set Password icon in the Actions collumn, which corresponds to the user whose password you want to change.

    cPanel - change MySQL user password

    You will see the Set MySQL User Password window.

    cPanel - set MySQL user password

  • Type the new password, confirm that is correct by retyping it in the Password (again) field and press the Change Password button.

* The system ranks the password you will use with 0 to 100. 0 means that your password is weak, while 100 means that your password is strong. You can also use the Password Generator to create a strong password. Attention, your password can not contain more than 7 charachters.


Change MySQL username

To change a users username, follow these steps:

cPanel - rename MySQL user

  • Press the Rename icon in Actions collumn for the user you want to raname. You should now see the Rename Database User window.

    cPanel - set MySQL user username

  • Type the new username on the field New name and press the Proceed button.


Delete a MySQL user

To delete a user, follow this steps:

  • Press the Delete button in Actions collumn corresponding to the user you want to delete.

    cPanel - delete MySQL user

  • You will now see a window like this:

    cPanel - MySQL user delete confirmation

  • If you are sure you want to delete permanently the user, press the Delete MySQL Users button.


MySQL Databases Wizard

cPanel - MySQL Databases Wizard

In the Databases section of your cPanel you will also find the MySQL Databases Wizard option. This wizard will guide you step by step to create your own database, to add a user in it and to define privileges for him. Through this option, you have the following options:

  1. Create a database
  2. Additional options


1. Create a database

Clicking the MySQL Databases Wizard option, you shold see this window:

cPanel - MySQL Databases Wizard - create database

  • In the New Database field, type the name that you want for your new database. Next press the Next Step button.

    * Note: the maximum length of a database name is 64 characters. This length includes the prefix of the database and the underscore character “_”.

  • The system informs you that your database has been created and asks to create a user who has access to it. For our example, we created the “example_examp” database.

    cPanel - MySQL Databases Wizard - user creation in the database

  • In the Username field, type the name of your database user.
  • Type in the Password field the password of this user and retype it in the Reenter Password field.

    * The system ranks the password you will use with 0 to 100. 0 means that your password is weak, while 100 means that your password is strong. You can also use the Password Generator to create a strong password. Attention, your password can not contain more than 7 charachters.

  • Press Create User.
  • The system informs you that the user has successfully created.

    cPanel - MySQL Databases Wizard - user previleges on the database

    Now you need to difine his previleges. Check the boxes corresponding to prvileges you want to grant for the user, or check the ALL PRIVILEGES button and press the Next Step button.

    The system informs that now the user you created, which in our example is “example_xuser”, has rights to the new database “example_examp”.

    cPanel - MySQL Databases Wizard - completion of granting user privileges in the database

* Note: when using MySQL Databases Wizard to create and make the initial settings on the database, the system automatically adds the user you will create on the new database. You will not need to add that user by selecting MySQL Databases.


2. Additional options

cPanel - MySQL Databases Wizard - additional options

After you complete the database creation process, you can select one of the following actions:

  • Add one more database. When selected, it takes you to the top of MySQL Database Wizard. Choose if you want to add another database.
  • Add another MySQL user. In this case, opens the MySQL Databases window, which you can use to create new users and add them to your database.
  • Return to your cPanel home page (Home).


PhpMyAdmin

PhpMyAdmin is a standalone tool that you can use to manage your databases. More information and instructions can be found on the phpMyAdmin website .

IPGLOBAL IKE   |  IP.GR Web Hosting and Domain Name registration services in Greece