How to Create or Delete MySQL Database or User?

Table of Contents

Databases are designed to store essential information across a set of tables controlled by a database management system (DBMS). MySQL Database is one of the world’s most popular database management systems.

It is free-to-use software that provides the stability, reliability, and security required for an effective database management system. This article provides a walkthrough process for creating or deleting a MySQL database or user.

How To Create A MySQL Database

If you want to create a MySQL Database, follow the steps below:

  1. Login to your HostPanel. Go to the Databases section in HostPanel. To find this option quickly, you can search by typing “database” in HostPanel’s search bar. Click on MySQL Databases.

    HostPanel MySql Database Section
    HostPanel MySql Database Section
  2. Give your new database a name.

    Give Your Database a Name
    Give Your Database a Name
  3. Click on the Create Database button.

    Click on Create Database Button
    Click on Create Database Button

If you successfully created your database, a success message will be displayed. And this new database will be added to the list of existing databases.

How To Delete A MySQL Database

To delete a MySQL Database:

  1. Go to the Existing Databases section. Click the Delete button for the exact MySQL database you want to delete.

    Delete MySQL Database
    Delete MySQL Database
  2. A confirmation box will pop up. Click on the YES button to confirm the action.

    Click on the Yes button to confirm action
    Click on the Yes button to confirm the action.
  3. By doing this, you will successfully delete your database.

Creating or Deleting A MySQL Database User

We offer to create a MySQL database user to provide additional security for your website’s database. The user is assigned a username and password, which is separate from the HostPanel credentials.

Before any user except the website owner can access the database, it will request to verify the authenticity of the registered login credentials.

How To Create A MySQL Database User

To create a new MySQL Database User, follow the steps below:

  1. Login to your HostPanel account. Go to the Databases section in HostPanel. To find this option quickly, you can search by typing “database” in HostPanel’s search bar. Click on MySQL database.

    HostPanel MySql Database Section
    HostPanel MySql Database Section
  2. Scroll to the New MySQL User section, type the username, and password, and repeat the password.

    Click create button to create new database user
    Click Create button to create the new database user
  3. Click on the Create User button.

Now you have successfully created a new MySQL database user. This user account differs from that of a hosting control panel, website administrator, and mail administrator account.

How To Delete A MySQL Database User

If you want to delete a database user:

  1. Go to the Existing MySQL Users list and select the Username you want to delete. Click the Delete button.

    Delete MySQL User
    Delete MySQL User

Define User’s Privileges

Now that you have successfully created a new user account, it is important to assign user privileges to determine the user’s level of control over the database. As a website owner, you don’t need to give anyone full database access.

Assign Database User Privileges

To assign privileges to a new MySQL database user, follow the steps below:

  1. Login to your HostPanel account. Go to the Database section in HostPanel. To find this option quickly, you can search by typing “database” in HostPanel’s search bar. Click on MySQL database.

    HostPanel MySql Database Section
    HostPanel MySql Database Section
  2. Scroll down and click on the Grant Access To Database section.

    Create user privileges
    Create user privileges
  3. Select the user you want to assign database privileges and select the specific database assigned to the user.

    Add user to database
    Add user to database
  4. Click on Add user to the database.

    Assign Database User Privileges
    Assign Database User Privileges

You have successfully assigned privileges to a MySQL database user.

Conclusion

You learned how to create and delete databases by following the step-by-step processes described in this article.

You also learned how to create MySQL database users and grant user privileges.

If you encounter any obstacles while setting up any of these processes, please contact our technical support team

 

Picture of softxaa

softxaa

Share Us With Your Friends

Get Lifetime Free Domain Now!

Unlock a Lifetime of Value: Get a Free Domain with Any 1-Year Cloud Hosting Plan!