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?

If you have a lot of web data to manage on your site, or you want your visitors to subscribe to your website or newsletter, databases are here to make things easier.

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

How to Use a MySQL Database?

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

Host: localhost
Database: yourcPanel_login_databaseName
Login: yourcPanel_login
Password: the password for 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 access rights to the user on 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 on the “Create Database” button.
Note: Your database name will always begin with some letters or numbers followed by the character _.

Create MySQL database

The database has been successfully created.

Creating a MySQL User in cPanel

To access the MySQL databases you’ve created, you need to create a MySQL user.

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

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

Create MySQL database user cPanel

Note: The MySQL username will always begin with some letters/numbers followed by the character _.

In this example, the database will be named: demodoma_test

Your user is now created.

Managing Access Rights for the User on the Database

1- Select the username you just created, along with the data

Articles Liés