Creating and Managing Databases in cPanel

This guide explains how to create MySQL databases and users in cPanel, assign permissions, and manage your databases using the built-in tools. These steps are essential for applications like WordPress, Drupal, and other software that require database storage.

  1. Accessing the Database Tools
  1. Log in to your cPanel dashboard.
  2. Scroll to the Databases section.
  3. You will see two key tools:
  • MySQL Databases
  • phpMyAdmin

This article focuses on the MySQL Databases tool for creating and managing databases.

  1. Creating a New Database
  1. Open MySQL Databases.
  2. Under Create New Database, enter a name for your database.
  3. Click Create Database.
  4. You will see a confirmation message once the database is created.

Your database will now appear in the list of existing databases.

  1. Creating a Database User

A database user is required for applications to connect to your database.

  1. Scroll to the MySQL Users section.
  2. Enter a username.
  3. Set a password or use the password generator.
  4. Click Create User.

This creates a user account, but it does not yet have access to any database.

  1. Assigning a User to a Database

To allow the user to interact with the database:

  1. Scroll to Add User to Database.
  2. Select the user you created.
  3. Select the database you want them to access.
  4. Click Add.
  5. Choose the permissions to grant:
    • For most applications, select All Privileges.
    • For restricted access, choose only the permissions needed.
  6. Click Make Changes.

Your application can now connect using the database name, username, and password.

  1. Managing Existing Databases

In the Current Databases section, you can:

Check Database Size

Useful for monitoring resource usage.

Repair Database

Fixes common issues such as corrupted tables.

Delete Database

Removes the database entirely.
Use this carefully, as deletion is permanent.

  1. Managing Database Users

In the Current Users section, you can:

Change Password

Update the user's password if needed.

Rename User

Change the username (note that applications using the old username will need updating).

Delete User

Removes the user and their access to all databases.

  1. Connecting Your Application to the Database

Most applications will ask for the following details during setup:

  • Database Name
  • Database Username
  • Database Password
  • Database Host (usually localhost on Stormy Hosting)

These values allow your application to communicate with the database.

  1. Troubleshooting Common Database Issues

Cannot Connect to Database

  • Check that the username is assigned to the correct database.
  • Confirm the password is correct.
  • Ensure the database host is set to localhost.

Access Denied Errors

  • The user may not have the required privileges.
  • Reassign the user and select All Privileges.

Database Not Showing in Application

  • The application may be using the wrong database name.
  • Verify the prefix added by cPanel (for example, username_dbname).

Corrupted Tables

  • Use the Repair Database option in cPanel.
  • If the issue persists, check the database in phpMyAdmin.

 

Ця відповідь Вам допомогла?

Схожі статті

How to Create and Manage Email Accounts in cPanel

This guide explains how to create, manage, and access email accounts for your domain using...

Using phpMyAdmin to Manage MySQL Databases

This guide explains how to use phpMyAdmin in cPanel to view, edit, and manage your MySQL...

Managing Domains and Subdomains in cPanel

This guide explains how to manage your domains and subdomains in cPanel, including adding new...

Understanding and Using cPanel File Manager

This guide explains how to use the cPanel File Manager to upload, edit, organise, and manage...

Setting Up and Managing FTP Accounts

This guide explains how to create, configure, and manage FTP accounts in cPanel. You will learn...

Powered by WHMCompleteSolution