Knowledgebase

MySQL Databases  Print this Article

Databases allow you to manage large amounts of information easily over the web. They are necessary to run many web-based applications such as bulletin boards, content management systems, and online retail shops.

Create a new database

To create the database, perform the following steps:

  1. In the New Database text box, enter a name for the database.
  2. Click Create Database.
  3. Click Go Back.
    • The new database will appear in the Current Databases table.

Note: To enter new information in a database, you can use the phpMyAdmin client that is installed with cPanel. For more information about phpMyAdmin, visit the phpMyAdmin website.

Modify Databases

Check a database for errors

If you experience problems with any database related software you have installed on the server, check your databases for errors.

To check a database, perform the following steps:

  1. In the Check DB menu, select the database that you wish to check.
  2. Click Check DB.
    • cPanel will run a script that checks to make sure the database is functional.
      • If cPanel detects a problem in the database, it will indicate which table is corrupted.
      • If the Check Complete message appears without a notification that the database is corrupted, then the database is functional.

Repair a database

If you have checked a database and found an error, you will need to repair it.

To repair a database, perform the following steps:

  1. In the Repair DB menu, select the database that you wish to repair.
  2. Click Repair DB.
  3. cPanel will run a script that attempts to automatically repair the database.

Note: This will only attempt to repair the database. A repair may not be possible. In this case, you will be able to locate the source of the corrupt data.

Create a database user

After you create the database, you will need to add users and their privileges so that the database can be filled and managed. MySQL® user accounts must be created separately from mail and web administrator accounts.

To create a new user account, perform the following steps:

  1. To quickly access the MySQL Users interface, click Jump to MySQL Users.
  2. Under Add New User, enter a username.
  3. Enter a password in the Password text box.

    Notes
    The password must be seven letters or shorter.
    To generate a strong password, click Password Generator.

  4. Reenter the password in the Password (Again) text box.
  5. Click Create User.

Define a user's privileges

Privileges define how the user is able to interact with the database. For example, they will determine whether the user can add and delete information.

To define a user’s privileges, perform the following steps:

  1. Under Add User to Database, select a user from the User menu.
  2. From the Database menu, select the database to which you wish to allow the user access.
  3. Click Add.
  4. From the MySQL Account Maintenance screen, select the privileges you wish to grant the user, or select ALL PRIVILEGES.
  5. Click Make Changes.

The Current Databases table

This table contains a list of databases on your server.

For each database, the table displays the following information:

  • The name of the database.
  • The size of the database.
  • Users who may manipulate the database.
  • A link allowing you to delete the database.

Search databases

To search the Current Databases table, perform the following steps:

  1. Type your criteria in the Search text box.
  2. Click Go.

The table will display the search results.

Modify a user's privileges

To modify a user’s privileges for database management, perform the following steps:

  1. Click the user’s name where it appears in the appropriate row.
  2. On the MySQL Account Maintenance interface, select the actions that you wish to allow the user to perform, and deselect the actions that you wish to prohibit.
  3. Click Make Changes.

Remove a user from a database

To remove a user's privileges for database management, perform the following steps:

  1. Click the  icon next to the user you wish to delete in the Current Databases table.
  2. If you are sure you want to remove the user’s privileges to manage the database, click Yes.

Delete a database

To delete a database from the server, perform the following steps:

  1. Locate the row that corresponds to the database you wish to delete in the Current Databases table.
  2. Click Delete Database.
  3. If you are sure you want to permanently delete the database, click Yes.

The Current Users table

Change a MySQL user's password

To change a MySQL user's password, perform the following steps:

  1. In the Current Users table, click the username for which you wish to change the password.
  2. Enter the current password for the user in the Old Password text box
  3. Enter the new password for the user in the Password text box.

    • The password must be 5 characters or longer.
    • To generate a strong password, click Password Generator.
       
  4. Enter the new password for the user again in the Password (again) text box.
  5. Click Change Password.

Delete a MySQL user

To delete a MySQL user account, perform the following steps: 

  1. Click  in the appropriate row of the Current Users table.
  2. If you are sure you want to permanently delete the account, click Yes.

Was this answer helpful?

Also Read

phpMyAdmin Databases
phpMyAdmin is a third-party tool that is included with cPanel and is used for the management of...
Remote MySQL
Databases in cPanel can be accessed remotely by other web servers. This can be useful if you want...
MySQL Database Wizard
cPanel can guide you through the setup of a MySQL database with the requisite accounts and...