Skip to content

Create a new MySQL database

Creating a new MySQL database in cPanel is a straightforward process. Follow these steps to create a new database and user, and grant the user access to the database:

  1. Log in to cPanel:

    • Open your web browser and go to your cPanel login page.
    • Enter your username and password to log in.
  2. Access MySQL Databases:

    • In the cPanel dashboard, locate the “Databases” section.
    • Click on the “MySQL Databases” icon.
  3. Create a New Database:

    • In the “Create New Database” section, enter a name for your new database in the “New Database” field.
    • Click the “Create Database” button.
  4. Create a New Database User:

    • Scroll down to the “MySQL Users” section.
    • In the “Add New User” section, enter a username and password for the new database user.
    • Re-enter the password to confirm it.
    • Click the “Create User” button.
  5. Add User to Database:

    • Scroll down to the “Add User To Database” section.
    • Select the newly created user from the “User” dropdown menu.
    • Select the newly created database from the “Database” dropdown menu.
    • Click the “Add” button.
  6. Set Database User Privileges:

    • After adding the user to the database, you will be prompted to set the user’s privileges.
    • Select the privileges you want to grant to the user (typically, you will select “ALL PRIVILEGES”).
    • Click the “Make Changes” button to apply the privileges.
  • Naming Conventions:

    • Use a clear and consistent naming convention for your databases and users to avoid confusion.
  • Strong Passwords:

    • Always use strong, unique passwords for your database users to enhance security.
  • Database Management:

    • Use phpMyAdmin, accessible from cPanel, to manage your databases, run SQL queries, import/export data, and more.

By following these steps, you can successfully create a new MySQL database and user in cPanel.