How do I create a MySQL database, a user, and then delete if needed?

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.

Log into your cPanel:

  1. Click the MySQL Databases icon
  2. In the box to the right of New Database, please provide a name for the database. Please note cPanel will create the full name of the database as cpaneluser_databasename
  3. Click the Create Database button

You have now successfully add the database, You will now need to crate a user to access the database.

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:

  1. Click MySQL Databases
  2. Scroll down until you see the Current Users section
  3. Under this section and to the right of User name, please provide a user name for a database
  4. Please note that that full database user will be cpaneluser_databaseuser
  5. To the right of Password, please type the password for which you would like to create for this database user.
  6. Click Create User

You have now created a database user. You can manage it from PhpMyAdmin, found in the Databases section in cPanel.

You now need to give the user privileges for your specified database.

  1. In the drop down menu to the right of User, please sect the user for which you would like give privileges to.
  2. To the right of Database, please select a database for which you would like the user to have privileges to.
  3. Under privileges please choose what type of privileges you would like the user to have.
  4. Click Add User To Database button You have now created a new database with a privileged user. You can now input the information into a php script or another script to access it locally

You have now just gave a user permissions to 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:

  1. Click MySQL Databases
  2. Under Current Databases, you will find the names of all your current databases.
  3. Click Delete next to the name of the database you would like to delete.

You have now deleted a MySQL Database.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Creating A New File In File Manager In Cpanel

You may also create binary files with the help of File Manager. Find below the steps to execute...

How do I add an Apache handler?

1. Click on the “Apache handlers” link in Cpanel. (under the 'site management header.) 2. Enter...

How do I change my account password in Cpanel?

1. Click on 'Change Password' under the 'Site Management' header in Cpanel.   2. Enter your...

How do I password protect a directory?

You can password protect directories within your site from unauthorized users by using 'Web...

How can I access mysql database remotely?

Under the mysql header in Cpanel, select 'manage mysql' Then scroll down to the 'access hosts'...