WEB HOSTING

How to create a MySQL database in cPanel?

Creating a MySQL database in cPanel is very beneficial for the proper functioning of your website.

What is a MySQL database?

Do you have a lot of web data to process on your website? Do you want your visitors to be able to subscribe to your website or your newsletter? Databases are here to make your task easier.

A MySQL database is a database management system that allows you to store, organize, and analyze large amounts of information in minimal time.
Many sites, such as WordPress and Prestashop, use the MySQL system to store all the information needed for the proper functioning of the site.

How to use a MySQL database?

If your database is already created and you simply want to connect to it, here is the information you will need:

Host: localhost
Database: yourcPanelLogin_databaseName
Login: yourcPanelLogin_username
Password: the password of the user you created

How to create a MySQL database?

In this section, we will answer three questions:

  • How to create a database?
  • How to create a database user?
  • How to grant user access rights to the database?

Creating a database

1. Log in to your cPanel account, scroll down and click on the “MySQL Databases” icon

MySQL Databases cPanel

2. Enter the name you want to assign to this database, then click the “Create Database” button.
Note: Your database name will always start with a few letters or numbers followed by the character _

Create MySQL database

The database has been successfully created.

Creating a MySQL user in cPanel

To be able to access the MySQL databases you have created, you need to create a MySQL user.

1. Go back to the “MySQL Databases” section, and scroll to “MySQL Users

2. Fill in the required fields under “Add New User” then click the “Create User” button

Create MySQL database user cPanel

Note: The MySQL username will always start with a few letters/numbers followed by the character _

In this example, the database will be named: demodoma_test

Your user is now created.

Managing user access rights to the database

1- Select the username you just created, as well as the database it will be allowed to manage.

Add user to MySQL database cPanel

2- Click the Add button (you can assign as many users as you like to a single database).

4. Check the privileges you want to grant this user, then click the “Make Changes” button.

MySQL Database cPanel

Your MySQL user is now fully functional and can manage the database according to the privileges you granted.

Articles Liés