How to create a MySQL® database

Creating a MySQL database within cPanel allows you to store and manage data for your websites and applications. Follow these steps to create and configure a MySQL database in cPanel.

1. Log in to cPanel

Access your cPanel account by entering the following URL in your browser’s address bar:

https://cpanel.yourdomain.com/

2. Find the Databases section

Once logged into cPanel, scroll down to the "Databases" section. Here, you’ll find several options related to database management.

3. Create a new database

Click on "Manage My Databases". On the next page, you'll see a field titled "New Database". Enter a name for your database and click the "Create Database" button.

Example:
  • Database Name: mysite_db

4. Add a database user

In the "Database Users" section, create a new user by providing a username and a strong password. Be sure to remember this password, as it will be needed to connect to the database from your application or script.

Click on "Create User" to complete this action.

Example:
  • Username: user_mysite
  • Password: SecurePassword123!

5. Assign the user to the database

Next, go to the "Add User to Database" section. From the dropdown menus, select the user you just created and the database you created earlier.

Click on "Add".

6. Manage privileges

On the next screen, you’ll see a set of privileges that you can grant to the user for managing the database. Common privileges include:

  • All Privileges: Grants the user full control over the database.
  • Select, Insert, Update, Delete: Allows the user to perform basic data operations.

Select the privileges you want to grant to the user and click "Make Changes".

7. Finalize the process

Once the privileges are assigned and changes are made, your MySQL® database is ready to be used with your website or application.

Now, you can use the database and user you created to connect your application or website to MySQL and start managing your data.