Databases are designed to store essential details and information across a set of tables controlled by a Database Management System (DBMS). MySQL is one of the most popularly used Database Management Systems.
It is a free-to-use software that provides the stability, reliability, and security required for an effective database management system. This article provides a walkthrough process of creating or deleting a MySQL database or user.
How To Create A MySQL Database
To create a MySQL Database, use the following steps:
Login to your Control Panel
Go to the Databases section. You can type in the keyword ‘database’ for an accessible location.
Click on MySQL Databases
Give your new database a name.
Click on the Create Database button.,
If you created your database successfully, a success message would be displayed. It will also add your new database will also be added to the list of existing databases.
How To Delete A MySQL Database
To delete a MySQL Database:
Go to the Existing Databases section
Click the Delete button for the exact database you wish to delete
A confirmation box will pop up. Click on the YES button to confirm the delete action.
By doing this, you will successfully delete your database.
Creating A MySQL Database User
We create a MySQL database to provide additional security and authentication for your website’s database. The user is assigned a login username and password, which differs from the Windows login credentials and the cPanel.
Before any user, aside from the website owner, accesses a database, it would request the registered login credentials to validate its authenticity.
How To Create A MySQL Database User
To create a new MySQL Database User, follow these steps:
- Login to your cPanel account
Go to the Databases section. You can type in the keyword ‘database’ for an accessible location. Click on MySQL Databases
2. Scroll to the New MySQL User section, Type in the Username, Password and Repeat the Password
3. Click on the Create User button.
You have successfully created a new MySQL database user. This user account differs from that of a web and mail administrator account.
How To Delete A MySQL Database User
When you wish to delete a database user:
Go to the Existing MySQL Users section and select the Username you wish to delete
Click the Delete button
Define User’s Privileges
Now that you have successfully created a new user account, it is vital to assign user privileges to determine the user’s control level over the database. As a website owner, you do not want to grant full database access to just anyone.
Assign Database User Privileges
To assign privileges to a database user, follow these steps:
Login to your cPanel account
Go to the Databases section. You can type in the keyword ‘database’ for an accessible location. Click on MySQL Databases
Scroll to the Grant Access To Database section
Select the user you would like to assign database privileges to and select the specific database assigned to the user.
Click on Add user to database
You have successfully assigned privileges to a database user.
Conclusion
By following the step-by-step processes outlined in this article you have learned how to create and delete databases.
You have also learned how to create MySQL database users and assign user privileges.
If you encountered any hitches while setting up any of this processes, please leave a comment below and we would be happy to help out.