How to Create a Database and Database User in cPanel

Step 1: Log in to cPanel

  • Open your web browser and navigate to your hosting provider's cPanel login page.
  • Enter your cPanel username and password.
  • Click Log In.

Step 2: Create a New Database

  • Once logged in, locate and click on the Manage My Databases icon in the Databases section.

image

  • In the Create New Database field, enter a name for your new database.

  • Click Create Database.

image

  • A confirmation message will appear, indicating that the database has been created successfully.

Step 3: Create a New Database User

  • On the Manage My Databases page, scroll down to the Database Users section.

image

  • Enter a username and a secure password in the Username and Password fields.
  • Click Create User.

image

  • A confirmation message will appear, indicating that the user has been created.

Step 4: Link the User to the Database

  • Scroll down to the Add User to Database section on the same Manage My Databases page.
  • From the User dropdown, select the user you just created.
  • From the Database dropdown, select the database you just created.
  • Click Add.

image

  • You will be redirected to the Manage User Privileges page. Check the box next to ALL PRIVILEGES to grant the user full access, or select specific privileges as needed.
  • Click Make Changes to save.

Step 5: Manage User Privileges

  • To modify privileges for an existing user, scroll to the Current Databases section on the MySQL Databases page.

image

  • Under the Privileged Users column, click the name of the user you wish to modify.
  • Select or deselect the privileges you want to assign or remove.

image

  • Click Make Changes to save the changes.

Conclusion: By following these steps, you can create a database, add a new user, and manage their privileges effectively in cPanel.