How to Create or Delete a MySQL Database or User

I. Introduction 

Mysql Database offers a method for managing large amounts of information over the web easily. It is necessary to run many web-based applications such as bulletin boards, content management systems, and online retail shops.

 

II. Create or Delete a MySQL Database

1. Create a MySQL Database

To create Database in cPanel:

Step1- Log into "cPanel" and "locate Databases"

Step2- Click "MySQL Databases" .

Step3-In the New Database field, type a name for the database.

Step4- Click "Create Database" .

 

Step4- Click "Go Back" and a new database will appear in the Current Databases table.

 

2. Delete a MySQL Database

To delete a MySQL Database: 

Step1-Navigate to the "Current Databases" section of MySQL Databases.

Step2-In the "Actions" column of the table, click "Delete" next to the database you wish to delete.

Step3-Confirm that you wish to permanently remove the database. 

III. Create or Delete a Database User

MySQL user is a record in the MySQL server created for authentication purposes. This is different from the usernames that we use in logging into Windows or even in cPanel/WHM. Setting up a MySQL user provides more security to website’s databases as we can assign permissions to each user. The website’s owner does not need to grant just any user all access to their databases.

1. Create a Database User
 
To create a database user: 
Step1-Log into "cPanel" and locate Databases.
 
Step2-Click "MySQL Databases" .
 
Step3-Click "Jump to MySQL Users" in the top-left corner of the page.
 
Step4-Enter a username under "Add New User" .
 
Step5-Enter a password in the "Password" field. For help generating a strong password, click the "Generate Password" button.
 
Step6-Retype the password in the "Password (Again)" field.
 
Step7-Click "Create User" .
 
2. Delete a Database User
 
To delete a database user: 
Step1-Navigate to the Current Users section of MySQL Databases.
 
Step2-In the Delete column, click the Delete next to the user you wish to delete. 
 
 
IV.  Assign and unassigned  in Privileges to Database User
 
We need specific users to have permissions to perform website management tasks, like running queries or modifying databases.
This is when we grant privileges. Privileges determine how a user is able to interact with the database. For example, privileges will dictate whether or not the user can add and delete information.
 
1.  Assign Privileges to Database User
To assign privileges:
Step1-Log into "cPanel" and locate "Databases"
 
Step2-Click "MySQL Databases" .
 
Step3-Under "Add User to Database" , select a user from the "User" drop-down menu.
 
Step4-From the "Database" drop-down menu, select the database you wish to allow the user access to
 
Step5-Click "Add" .
 
Step6-From the "MySQL Account Maintenance" screen, select the privileges you wish to grant the user or select "ALL" .
 
Step7-Click "Make Changes" .
 
2. Unassigned a User from a Database
 
To unassigned privileges:
Step1-Navigate to the "Current Databases" section of MySQL Databases.
 
Step2-Locate the database you wish to modify.
 
Step3-In the Privileged "Users" column for that database, click the "X" next to the user you wish to delete.