After you have created a database in cPanel, a manually set up website or web application usually also requires a database user. This user logs into the database and is granted the permissions necessary to run the application.
However, simply creating the user is not enough. You must then assign them to the correct database and specify which actions they are allowed to perform there.
In this guide, we will show you step by step how to create a database user in CURIAWEB, assign a secure password, connect the user to a database, and set up the required permissions.
Important: Database, database users and user privileges are separate components. A newly created database user does not automatically have access to an existing database.
What do you need for a database connection? #
A web application typically requires several pieces of information to connect to its database:
- Database name
- Database user
- Database user password
- Database host
- sufficient user permissions on the database in question
If one of these components is missing or if any information is incorrect, the database connection may fail.
If a database does not exist yet #
If you haven't created a database yet, you should do this step first.
You can find the complete instructions at Create MySQL database in cPanel.
After that, you can proceed with the database user.
1. Log in to cPanel #
Log in to your CURIAWEB cPanel.
Then open:
Databases → Manage My Databases
This interface allows you to manage databases and database users, as well as assign users to a database.
2. Open section for database users #
Look for the section to create or manage database users within the database administration.
You can create a new user there.
The exact names of individual fields may vary slightly depending on the cPanel version and language setting.
3. Set username #
Assign a unique username for the application.
For example:
shop user
or:
wpuser
The username should allow you to make a meaningful assignment across multiple applications.
Do not use passwords or other confidential information in it.
4. Note full database username #
Like with the database name, cPanel can also automatically prepend a hosting account prefix to the database user.
For example, if your account prefix:
customer
is and you as a user:
shop user
you enter, the complete database user can look like this, for example:
customer_shopuser
Important: In your application's configuration, you must use the full database username as shown in cPanel.
5. Create a strong password #
Assign a strong, unique password for the database user.
Do not use simple passwords like:
123456
password
mysql123
or the name of your domain.
If cPanel offers a password generator, you can use it.
Safety: Do not use the same password for the database user as for cPanel, FTP, email, or WordPress. Each access should have its own password.
Special characters in the database password #
A strong password can contain special characters. However, if you enter the password manually in a configuration file later, you must ensure that it is correctly adapted according to the syntax of that file.
Do not accidentally change an automatically generated password when copying it.
Even an extra space at the beginning or end can cause the database login to fail.
6. Create database user #
Check the username and password and then create the user.
cPanel should confirm the successful creation.
The database user now exists – but does not automatically have access to your database yet.
Common mistake: Many database problems arise precisely at this point. The user was created, but subsequently not assigned to the database.
7. Assign users to a database #
Search in Manage My Databases the scope in which a database user can be added.
Select there:
- the correct database user
- the correct database
Carefully check both full names.
For example:
Database:
kunde_shop
User:
kunde_shopuser
Then add the user to the database.
Choose particularly carefully when using multiple databases #
If your hosting account contains multiple websites, there may correspondingly be multiple databases and database users.
Do not accidentally assign the user to another website's database.
Practical Tip: Use understandable database and user names. This makes it easier to tell months later which access credentials belong to which website.
8. Set user permissions #
After adding the user to the database, cPanel displays the available database privileges.
These permissions determine which actions the user is allowed to perform within this database.
This may include, for example, rights to read, insert, modify, delete, or manage tables.
What does ALL PRIVILEGES mean? #
cPanel usually offers a selection such as:
ALL PRIVILEGES
This gives the user the privileges available via this interface for the selected database.
For a typical web application that needs to fully manage its own database, this setting is often required.
Important: ALL PRIVILEGES for a specific database does not automatically mean that the user gets access to all other databases of your hosting account. The assignment applies to the selected database.
Why do web applications require extensive permissions? #
A web application doesn't just read data from its database.
Depending on the application, it must, for example:
- create new records
- modify existing datasets
- Delete data
- Create tables
- Modify table structures during updates
- Manage indices
If necessary permissions are missing, the application may work initially and still cause a database error later, for example during an installation or update.
Do not grant unnecessary privileges on other databases #
If a user is intended for only one specific website, they should not be assigned to additional databases without reason.
A clean separation can look like this, for example:
Website A
Database: kunde_webseitea
User: kunde_usera
Website B
Database: kunde_webseiteb
User: kunde_userb
This keeps the database access credentials of various applications separate from each other.
9. Save permissions #
Select the permissions required for your application and save the setting.
Afterwards, the database user should be assigned to the relevant database with the selected privileges.
10. Check assignment #
Return to database management and check if the user is listed under the desired database.
With this, you have set up the three core components:
Database
+
Database user
+
Permissions
Now the application can be configured with the appropriate credentials.
11. Enter access data in the application #
During a manual installation, the application usually requires the following values:
| Specification | Example |
|---|---|
| Database name | shop customer |
| Database user | customer_shopuser |
| Password | Database user password |
| Database host | Value according to hosting configuration |
The examples are for illustration purposes only. Use the actual values of your hosting account.
Enter the database host correctly #
In many web hosting configurations, the database host is:
localhost
used.
However, this is not a universally applicable value for every hosting environment.
Therefore, use the database host intended for your specific hosting account or application.
12. Test database connection #
Save the database credentials in your application and then retrieve them.
If the connection was set up correctly, the application should be able to access its database.
During a fresh installation, the application can then create its required tables.
WordPress and database access #
In WordPress, the database access data is usually located in:
wp-config.php
Among other things, values for:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
used.
Attention:
wp-config.phpcontains sensitive access credentials. Do not publish the file or its complete content, and only change the values if you know which database credentials should be used.
Connect WordPress to a new database after a migration #
If you are transferring a WordPress website to a new hosting account and have created a new database or a new database user there, the corresponding access data must be in wp-config.php fit in with the new environment.
It is not enough to just transfer the website files and the database.
The application must then also know which database and which user it should connect to.
Back up configuration file beforehand #
Before changing database access credentials in a configuration file, you should create a backup of the existing file.
We explain safe processing at Upload, download, and edit files in cPanel.
„Access denied after setup #
If an application displays a message with:
Access denied
displayed, the database login or permission could not be used as intended.
Check first:
- complete database username
- Password
- Database host
- whether the user has been assigned to the correct database
- whether the required permissions have been granted
Important: An existing database user alone does not prove that they are allowed to access the database in question. Always check the assignment as well.
„Unknown database is a different error #
If the application reports instead that the database does not exist, you should check the database name first.
For example, instead of:
shop
the full name:
shop customer
to be required.
We explain how databases are created and named at Create MySQL database in cPanel.
„Error establishing a database connection“ #
A general database connection error message can have various causes.
Check systematically:
- Does the database exist?
- Is the database name correct?
- Does the database user exist?
- Is the username correct?
- Is the password correct?
- Is the database host correct?
- Is the user assigned to the database?
- Does he have the required rights?
Do not change all values at once. Check them one by one.
Change database user password #
If you want to change the password of an existing database user, open:
Databases → Manage My Databases
Find the user in question and use the offered password change function.
Set a new strong password.
Attention: Changing a password in cPanel does not automatically update your website's configuration file. The application will continue trying to use the old password until you update its configuration as well.
After password change the website no longer works #
If the website shows a database error immediately after a password change, the old password is often still stored in the application.
Enter the new password in the corresponding application configuration.
In WordPress, this usually affects the value:
DB_PASSWORD
in
wp-config.php
Do not change the password unnecessarily #
If a production website is running smoothly, you should not change the database password without a specific reason.
A change is possible, but it must be coordinated with all applications that use this user.
If you do not know which website uses a specific database user, you should first clarify the assignment.
Assign a database user to multiple databases #
Depending on the hosting configuration, a database user can technically be assigned to multiple databases.
However, for independent websites, it is often clearer and more secure to use separate users.
As a result, a subsequent password change, for example, does not affect multiple independent applications at the same time.
Assign multiple users to a database #
Likewise, a database can have multiple authorized users depending on the configuration.
This can be useful for certain applications or administrative purposes.
However, do not create additional database users without a specific need.
Do not delete unknown database users on suspicion #
If there are multiple database users in cPanel and you do not know their purpose, you should not just delete them.
A user can be used by an active website or application.
If this user is removed, the application in question may lose its database connection.
How do I find out which user WordPress is using? #
In WordPress, you can usually find the database user in:
wp-config.php
based on:
DB_USER
determine.
The value entered there should match the database user in cPanel.
Delete database user #
When a database user is definitely no longer needed, you can use Manage My Databases remove.
Check beforehand that no active website or application is using this user.
Attention: Deleting a database user is not the same as deleting the database. The database may still exist, but the application may lose its access to it.
Remove user from a database #
If a user should only lose access to a specific database, you do not necessarily have to delete the entire database user.
You can remove the corresponding mapping if cPanel offers this management for your account.
Other existing user assignments are to be considered separately.
Modify permissions later #
If a user is already assigned to a database, their permissions can be adjusted if necessary.
However, do not remove any permissions from a production application on suspicion.
Missing rights can lead, for example, to:
- Content cannot be saved
- Updates fail
- tables cannot be created
- Database changes fail
Read-only rights are usually not sufficient for standard CMS #
A dynamic website typically needs not only to be able to read data, but also to write and modify it.
Therefore, read-only database access is not sufficient for the normal operation of many content management systems.
Do not confuse ALL PRIVILEGES with server administrator rights #
The designation ALL PRIVILEGES can initially seem very far-reaching.
In the context of cPanel assignment, however, it refers to the permissions available to that user on the selected database.
This does not automatically make the user an administrator of the entire database server.
Remote Database Access is separate from this #
Assigning a database user to a database does not automatically allow arbitrary external connections from the internet.
For external database access, a separate function exists in the CURIAWEB cPanel:
Remote Database Access
For a normal website on the same hosting system, you do not need to enable external database access just because the website uses MySQL.
Safety: Enable external database access only if it is actually required for a specific use case.
Database user and phpMyAdmin #
To manage the database contents, you have in cPanel phpMyAdmin available.
There, for example, you can view tables, check database structures, and perform imports and exports.
We explain how to use it at Use phpMyAdmin in cPanel.
Backup before making changes to production databases #
Creating or assigning a database user does not automatically change the existing database contents.
However, as soon as you want to modify tables or data within a production database, you should create a recent backup beforehand.
You can find the procedure under Export database with phpMyAdmin.
Database Wizard as an alternative #
If you want to set up a completely new database including a new user, you can alternatively use the in CURIAWEB cPanel Database Wizard use.
This guides you through it in a seamless sequence:
Create database
↓
Create user
↓
Set password
↓
Assign user
↓
Set permissions
Manage My Databases is particularly well-suited when databases or users already exist and need to be managed specifically.
Recommended workflow for a new database user #
- Log in to cPanel.
- Open Databases → Manage My Databases.
- Create a unique database user.
- Generate a strong, unique password.
- Note the full username.
- Select the user and the correct database.
- Add the user to the database.
- Grant the permissions required for the application.
- Save the assignment.
- Enter the access data in the application.
- Test the database connection.
Recommended procedure in the event of a database error #
- Check the full database name.
- Check the full database user.
- Check the password.
- Check the database host.
- Check the mapping between user and database.
- Check the assigned permissions.
- Test the application again.
Basic rule: A database connection does not just consist of a username and password. Database, user, assignment, permissions, and database host must all match.
When should you contact support? #
If an application cannot establish a connection despite a correctly configured database and user assignment, you should note the exact error message.
For an analysis, the following information is particularly helpful:
- affected domain or application
- full database name
- full database user
- used database host
- whether the user is assigned to the database
- what permissions have been granted
- exact error message
- whether the connection worked previously
- whether the database password was recently changed
Transmit in the process not the database password.
Summary #
A database user is located in the CURIAWEB cPanel under Databases → Manage My Databases created. Assign a unique username and a strong, independent password.
Note the full username that cPanel displays. For example, the account prefix can turn shop user the full user customer_shopuser become.
After creation, you must assign the user to the correct database and grant the permissions required for the application. For web applications that need to fully manage their own database, ALL PRIVILEGES often the appropriate setting on this database.
If a database connection is subsequently with Access denied fails, check not only username and password, but also database host, user assignment, and permissions.
If you change the password of a database user in production later, you must also update the new password in the configuration of the application in question.