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 and you can complete this educational process as quickly as possible and focus on important tasks such as defining and Focus on 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:

Table of Contents

  • Important points that you should know before creating a database in cPanel.
  • Method 1) Creating a database with the MySQL Databases tool
  • Method 2) Creating a database in cPanel with the MySQL Database Wizard tool
  • How to edit or delete 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.
  • If you have more experience and need more detailed control over the database, MySQL Databases is a better option.
  • 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, in order to be able 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 of the MySQL server that is created for the purpose of authentication and enhancing 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 password suggested by the Password Generator, click the Create User button to successfully create the database user.

 

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 you have certain restrictions in mind for them, it is better to check the desired options one by one.

 

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 and check the Current Databases section and see if the database you want is included in the list of databases or not. 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.

 

The steps of this method are step-by-step and you don’t need to look for database or user creation sections anymore.

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.

 

 

To create a safe and secure password for the MySQL user, you can use the password generator tool.

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, with the help of which you can specify the access level and operations allowed for the user.

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

 

Finally, by seeing the following message, you can make sure that the operation of creating the database and the user has been done successfully.

 

Using this method, you no longer need to do the step of assigning the user to the database because this process goes step by step and the user that is created is automatically assigned to the database that was 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 name of the desired user and database in the User and Database fields, respectively, and finally, click on the Add button.

3. After clicking on Add, the window for determining the privileges and access levels will open, so that you can 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 perform the necessary operations to create a database in cPanel, it’s time to start using the database.

To define the table and in general, manage the database you created with cPanel, you can use various tools that exist in cPanel, such as phpMyAdmin.

 

 

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.