Cloud Service >> Knowledgebase >> cPanel >> How to Create a Database Username in cPanel?
submit query

Cut Hosting Costs! Submit Query Today!

How to Create a Database Username in cPanel?

cPanel has been one of the most preferred control panel solutions; it gives users a user-friendly interface through which they would manage aspects of their hosting account. It includes databases, a very integral part of this management: create a database username. This tutorial will guide you in the process to create a database username in the cPanel to secure the required access in order to manage your databases.

Database Usernames in cPanel

Before executing the following steps, it's crucial to understand what a database username is and why it's so important. In general, a database username in cPanel refers to a unique identifier, paired with the password for their access to one or more databases. Such a factor is one of the critical ones toward security because it controls which users view, modify, or manage certain databases.

Prerequisites

You need the following before starting:

- Access to your cPanel account

- The necessary permissions to create database users

- A clear idea of the privileges you want to assign to the new user

How to Create a Database Username in cPanel Step by Step

1. Log into your cPanel account

Open your login to the cPanel account using your login details. If you're unsure of your login URL, you should refer to your hosting provider.

2. Locate the Databases section

Once you log in, move down to the "Databases" section. This is the section where all your tools to administer your databases sit, including creating new users.

3. Click on "MySQL Databases"

On the Databases section, find the icon with "MySQL Databases" and click on it to take you to the MySQL database administration page.

4. Scroll down to the "Add New User" section

Scroll down to the "Add New User" section on the MySQL Databases page. This is where you will create your new database username.

5. Enter new username

In the "Username" field, put in the desired new name for your new database user. Keep in mind that most hosts preface usernames with your account name so that your final username could look something like "accountname_username."

6. Generate a strong password

Navigate to the section to add a new user. Type in a strong password for the new user. Be sure to use a mix of both lowercase and uppercase letters, numbers, as well as special characters for maximum strength. The cPanel password strength meter will let you know the strength of the password you have chosen.

 

Alternatively you can use the "Password Generator" to generate a strong and random password automatically.

7. Add User

Fill in the username and password, then click the "Create User" button. cPanel will process your request and add the new database user.

8. Assign privileges to the new user

Following the addition of the user, you'll need to add privileges. Keep scrolling down until you get to the "Add User To Database" section.

 

Select the new user to whom you want to grant access using the "User" drop-down and then select the database to which you want to grant access using the "Database" drop-down.

 

Click "Add" to take you to the privileges page.

9. Assign Privileges for the New User

On the privileges page, you will be allowed to choose about what the user should be allowed to do on the selected database. To this end, you are allowed the following options:

ALL PRIVILEGES: Gives all privileges that will allow you into the database

SELECT: grants the right of permission to read data

INSERT: To insert new data

UPDATE: To alter a pre-existing record

DELETE: Delete already existing record

CREATE: Create a new table or database

ALTER: Change the structure of a table

INDEX: Create an index, or drop an index

DROP: Delete a table, or a whole database

Select relevant privileges according to user need and your security needs. You can select "ALL PRIVILEGES" for full access or you can select specific privileges for granular access.

10. Confirm Privileges

Once you decide which privileges you wish to apply, click on the "Make Changes" button for them to be applied

Best Practices for Database Username Management

Use unique usernames: Avoid usernames such as "admin" or "user." Use distinct names for different purposes or to identify users of different teams.

Use strong password: Ensure your password is complex to deny intruders access to your database

Review and update privileges from time to time: From time to time, the privileges accorded to the users should be reviewed, and unnecessary privileges removed to avoid weaknesses.

Record database users: You record created users, purposes, and assigned privileges for easier management

Use another user for different applications: If you have several applications in your application system, create a different user for them so they may troubleshoot any security issue.

Troubleshooting Common Errors

Username already exists: This error could be due to the username already existing. Try a different username or if you already have a user using the same name.

Privileges not taking effect: Ensure that you have clicked the "Save Changes" button after uploading your privileges. If the issue persists, try to delete the user and then add him again to the database.

Cannot create more users: You check your hosting plan limits. Some do not allow you to add so many users on the database.

Conclusion!

Creating a database user in cPanel is creating a database user who can be used in order to control access securely to your databases. This is achieved by running this guide; it will give you the steps on how to create a user, appropriate privileges, and how to keep track of database access. Never forget best practices in creating a username and password creation to secure the valuable data.

 

Once you get acquainted with how cPanel operates, you would manage a large number of databases and users much more effectively, which will in turn further facilitate the working of your websites and applications.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!