blog posts

How to Create a Database with cPanel

Today, database management systems, especially MySQL databases, have become an integral and essential member of any web-based application and continue to be prominent. In general, if you want to launch your application or website using content management systems or programming languages, you must first create a MySQL database server or another database. This is where you can complete this important and sensitive part of your application with the help of the CPanel dashboard by learning how to create a database in CPanel.

cPanel offers 2 excellent tools, MySQL Databases, and MySQL Database Wizard, for creating and managing databases, with the help of each of them, you can create a MySQL database or a user database using the cPanel user interface without the need to enter commands. Create and manage SQL manually.

In this article, we teach both tools or methods of creating a database in cPanel so that there is no ambiguity in this field. You can complete this educational process as quickly as possible and focus on important tasks such as defining and managing databases, tables, and relationships between them.

Of course, if you need a powerful and secure server to start your project and the upgradeability of resources is one of your priorities.

It’s time to learn how to create a MySQL database in cPanel:

Important points that you should know before creating a database in cPanel.

  • Your cPanel account must be equipped with database access permission.
  • You can use MySQL Databases or MySQL Database Wizard to create a database in CPanel.
  • Each of these tools has its own tasks and standards.
  • The MySQL Database Wizard tool is more suitable for novice users as it provides a step-by-step guide.
  • MySQL databases are a better option if you have more experience and need more detailed control over the database.
  • Carefully review the needs and requirements of your project.
  • Specify the type of information you want to store in the database.
  • Choose the database name carefully.
  • Database name can have maximum 64 characters.
  • By creating a database in cPanel, you are able to backup and restore it.
  • Make sure that the version of MySQL installed on the server is compatible with the version of cPanel.
  • Choose a strong password for your database.
  • Be careful in determining and managing access levels and only grant access to specific and trusted users.
  • Before creating a database, consider a suitable way to back up the data.
  • Determine your needs and capabilities for database management such as indexing.
  • Plan on updating and maintaining your databases.
  • Plan on managing and monitoring the database and related events.
  • Document any changes to the database structure well.
  • After building the database, run appropriate queries to ensure its integrity.

Now that you know these tips, it’s time to start creating secure and efficient databases by following these rules.

Method 1) Creating a database with the MySQL Databases tool

To create a MySQL database in cPanel, just follow the steps below:

1. Log in to your cPanel account according to the tutorial on how to log in to cPanel.

2. From the Databases section, click on the MySQL Databases option.

3. Find the field for Create New Database. Choose an appropriate name for the new database and then click the Create Database button.

Your desired database has been successfully created.

4. Create a MySQL user.

Now, to manage this database, create a MySQL user and assign all necessary privileges to access and manage the database.

A MySQL user is a record on the MySQL server created to authenticate users and enhance database security.

* Please note that MySQL user accounts are created independently of email and web admin accounts and have a completely different purpose.

So, to create a database user, find the section related to MySQL User and Add New User from the same MySQL Databases.

Then, choose a strong and secure username and password for this user.

If you want to have a safe and verified password for cPanel, we recommend that you use the internal Password Generator tool. Password generation by the internal tool

Remember this username and password you specified for the database user as you will need it in the future.

After entering your desired password or the password suggested by the Password Generator, click the Create User button to create a database user successfully.

5. Assign the MySQL user to your desired database.

Now that you have created both the database and the MySQL user, you need to establish a relationship between them and set the necessary privileges for the user to access, manage, initialize and maintain the database.

To do this, find the Add User To Database section and enter the name of the desired user and database in the User and Database fields, respectively, and finally, click on the Add button.

6. Specify user privileges and access levels.

After you click the Add button, the window for setting points will open. If you want to assign all the necessary privileges to manage and manipulate the database to the desired user and do not include any restrictions, check the All Privileges option and click the Make Changes button.

If you do not want the target user to have full access to the database and have certain restrictions in mind for them, it is better to check the desired options individually.

7. Check user and database status.

After you go through the above steps, you can confirm that the operation was successful by seeing the following message.

Click on “Go back” to check the Current Databases section and see if the database you want is included in the list. If you can see the database, congratulations. You have successfully completed the database creation process in cPanel.

Method 2) Creating a database in cPanel with the MySQL Database Wizard tool

The steps related to the Wizard tool are similar to the previous method, with the difference that in this method, the process of creating a database in CPanel proceeds sequentially and step by step. To use this tool, just follow the steps below:

1. From the Databases section, click on MySQL Database Wizard.

This method is step-by-step, and you no longer need to look for database or user creation sections.

As soon as you click on the MySQL Database Wizard, the section for entering the database name will open.

2. Enter the name of the database and click the Next Step button.

3. Enter the desired username and password and click on the create user button.

You can use the password generator tool to create a safe and secure password for the MySQL user.

Then click on the create user button to create a new user.

4. Specify the privileges and access level of the database user.

After you click on the create user button, the privilege setting window will open. In this window, you can specify the user’s access level and allowed operations.

If you want to assign all the access privileges for the desired user, check the All Privileges option and click the make changes and next step buttons, respectively.

Finally, the following message indicates that the operation of creating the database and the user has been completed successfully.

Using this method, you no longer need to assign the user to the database. This process goes step by step, and the user created is automatically assigned to the database created in a previous step. It is added.

How to edit or delete a database in cPanel

So far, you have learned how to create a database in cPanel, but in order to be able to use it correctly, you must be familiar with how to perform a series of operations so that you can get to work and do the necessary things yourself when necessary. Deleting and editing databases and users related to them are among the most important operations and learning how to do them will be very useful for you:

* For any deletion/editing operation, you must use the MySQL@Databases tool.

How to delete a database in cPanel

1. Log in to your cPanel account and click on MySQL Databases from the Databases section.

2. From the Current Databases section, check the databases you have created so far.

3. From the actions section of the desired database, click on the delete option.

4. If you are sure about the database deletion process, click the delete database button.

After going through these steps, your desired database will be deleted.

How to delete a user

1. Log in to your cPanel account and click on MySQL Databases from the Databases section.

2. Scroll down and select the desired user from the Current Users section.

3. From the actions section of the desired user, click on the delete option.

4. If you are sure about the database deletion process, click the delete User button.

After going through these steps, your desired user will be deleted.

Assigning another user to the desired database

For this, just follow the steps below:

1. Click on MySQL Databases.

2. Then, from the Add User To Database section, enter the desired user and database names in the User and Database fields, respectively, and finally, click the Add button.

3. After clicking on Add, the window for determining the privileges and access levels will open. This allows you to assign suitable privileges to the target user according to your strategies.

4. Finally, click on Make Changes to save these changes.

How to Delete a user from the database

If for some reason you have decided to terminate a user’s access to the database and disconnect them, just follow the steps below:

1. Open MySQL Databases and go to the Current Databases section.

2. Find the database you want from the list in this section.

3. Click on the trash icon from the Privileged Users column of your desired database.

Now that you know how to create a database in cPanel, you can start using it.

Various tools, such as phpMyAdmin, can be used in cPanel to define the table and manage the database you created.

Then, when it comes time to connect the database to the web applications, it is enough to enter the database connection information such as database name, username and password of one of the users of this database in your web applications and start work

Conclusion

Databases are one of the main parts of the back-end of websites and web applications that require a lot of sensitivity. Fortunately, the cPanel tool includes two easy tools for creating and managing databases in cPanel, with the help of which you can make this process much faster and safer. The tutorials presented in this article can make the process of learning how to create a database in cPanel much easier for you so that you can continue on your way as quickly as possible.