Your cPanel allows you to easily create a MySQL database, create database users, and assign database user privileges. You can also delete databases and remove database users.
1. Create the Database
Create: If you are using any type of PHP software or keeping a collection of records which need to be accessed in some way, you will need to create a database. Below will show you how to create a MySQL database in cPanel.
- Click the MySQL Databases icon.
- Under "Create New Database" enter the name of the Database you wish to create.
- Click the Create Database button.
You have now successfully added the database, You will now need to create a user to access the database.
2. Create a Database User and Assign Privileges
Create User: Whenever you have any type of MySQL database, you will need to assign a user to be able to access the database. If you would like to create a user and give them access to the database, please do the following:
- Click MySQL Databases
- Scroll down until you see "Add New Users".
- Enter your database username.
- Enter your database password.
- Enter your database password one more time.
- Click Create User.
2.1 Assigning the Database a User.
- Under "Add User To Database" you will see two dropdown menus. These will reflect your existing Databases and Users.
- In the User drop down, Select the username you wish to assign to your Database.
- In the Database drop down, Select the Database you would like assigned to the username.
- Click "Add" Once you have selected desired Database and username to be assigned.
An example of this would be : cpaneluser_database or cpaneluser_dbuser
2.2 Assigning the user privileges.
- Click "ALL PRIVILEGES" to select all of the required Database privileges.
- Click "Make Changes" to finalize the changes and add the user to the database.
3. Delete a Database
Delete : If you are deleting a script or would like to restart a new database, the first step is to delete the old MySQL database. To do so, please do the following :