Almost every website needs to have a database on which all the data is stored. This tutorial will help you learn
how to create a database and user in cPanel. Every database also needs a username to access it so we will also mention here
how a username should be created.
What you’ll need
Before you begin this guide you’ll need the following:
- Access to your cPanel
Table of Contents
Step 1 — Logging into cPanel and selecting MySQL Databases
Access your cPanel and navigate to MySQL databases.
Step 2 — Entering database name
Database name should be entered in the input field (Name should be entered without spaces). Enter the name and press Create Database button.
Step 3 — Creating username
Scroll down and you will see Add New User section there. Enter username to the input field (Name should be entered without spaces). Enter your password and repeat it (Password generator button can be used to create a random password). Press Create User button afterwards.
Step 4 — Adding User To the Database
Below there is Add User To Database section. Here you should select User from the dropdown list which was just created and select the database to which it should be assigned. Press Add button.
After pressing the Add button, Step 5 picture of privileges appears on your screen so move to the next step.
Step 5 — Providing all the privileges
On this step just leave all the privileges selected and press Make Changes button.
If everything was done correctly, you have successfully created a database, username and assigned that username to the database with all the privileges. It can now be used to access a database for any script or website you are developing. Please keep in mind this tutorial is used to create an empty database only. Tables and all the entries on them should be created manually or imported.