Assign a MySQL user to a specific database in cPanel to grant that user the necessary permissions to manage the database. This process ensures that your database credentials are correctly linked to your database records.
Before you begin
You will need:
A cPanel account with the appropriate permissions to manage databases.
The name of the database you wish to assign the user to.
The specific MySQL username you want to associate with that database.
Assign a MySQL User to a Database
Log in to your cPanel account.
Locate the Databases section and select MySQL® Databases.
Scroll down to the Add Databases section.
Under Create New Database, enter the name of the database.
Under More Features, select the checkbox for the specific database you want to manage.
Select the appropriate MySQL User from the list of available users.
Click Add User to Database.
Note: If you are using the MySQL® Database Wizard, you can perform the creation of the database, the user, and the assignment of privileges in a single step.
Confirm the result
The system will display a success message confirming the user has been added to the database.
The database will now appear in the list of databases with the assigned user associated with it.
You can verify this by viewing the Privileged Users or MySQL® Databases list to ensure the user is listed next to the correct database.
Troubleshooting
The user does not appear in the list of available users. Ensure that the MySQL user has been created first. You must create a user in the MySQL® Database section before you can assign them to a specific database.
The "Add User to Database" button is not clickable. Ensure you have selected both a database and a user from the respective dropdown menus or selection lists before attempting to click the button.
