Creating a MySQL database in cPanel is a fundamental step for setting up dynamic websites and web applications such as WordPress, Joomla, Drupal, or custom-built platforms. This guide will walk you through the process of creating a MySQL database, user, and assigning privileges in cPanel.

 

1. Log in to cPanel

  1. Open your browser and navigate to your website's cPanel login page (https://yourdomain.com/cpanel).

  2. Enter your username and password

  3. Click Log in.

2. Locate the MySQL Databases Section

  1. In the cPanel dashboard, scroll down to the Databases section.

  2. Click on MySQL® Databases.

3. Create a New Database

  1. Under the Create New Database heading, enter a name for your database.

    • Note: The database name will typically begin with your cPanel username followed by an underscore (e.g., username_dbname).

  2. Click Create Database.

  3. A confirmation message will appear indicating the database has been created successfully.

4. Create a Database User

  1. Scroll down to the MySQL Users section.

  2. Under Add New User, enter a username.

  3. Enter a secure password in both the Password and Password (Again) fields.

    • Alternatively, click Password Generator to automatically create a strong password.

  4. Click Create User.

  5. A success message will confirm the new user has been created.

5. Add User to Database

  1. Scroll to the Add User to Database section.

  2. From the User dropdown, select the user you just created.

  3. From the Database dropdown, select the database you created earlier.

  4. Click Add.

  5. On the next screen, choose the privileges you want to assign:

    • To grant full access, check All Privileges.

    • Otherwise, select the specific permissions required by your application.

  6. Click Make Changes to apply the privileges.

6. Confirm Your Setup

  1. Scroll to the Current Databases section to view your existing databases and users.

  2. Confirm that your newly created user is listed next to your new database.

7. Use Your Database

You can now use your MySQL database in your web application. You'll need the following credentials:

  • Database name

  • Database username

  • Password

  • Database host (usually localhost on most shared hosting platforms)

Use these details to configure your CMS or application to connect to the database.

 

Additional Tips

  • Keep your credentials secure and avoid using easily guessable names or passwords.

  • If you're installing a CMS like WordPress, this database setup is typically the first step during installation.

  • You can manage your databases later using phpMyAdmin, which is also available in the Databases section.

 

Setting up a MySQL database in cPanel is a straightforward process. Once done, you’re ready to connect your site or app to the database and begin storing and retrieving data.

Was this answer helpful? 0 Users Found This Useful (0 Votes)