cPanel provides a centralized interface for creating and maintaining MySQL databases, database users, and access permissions. Proper database management is essential for application stability, security, and performance.
These features are available on standard cPanel hosting environments.
Managing database users
Database users authenticate applications and control access to data. Create users before assigning them to databases.
Creating a database user
- Log in to cPanel.
- Open the Tools page.
- In the Databases section, click Manage My Databases.
- Under Add New User, enter a username.
- Set and confirm a strong password or use the password generator.
- Click Create User.
[Screenshot placeholder: Add New MySQL User]
Changing a user password
- Open Manage My Databases.
- Under Current Users, locate the user.
- Click Change Password.
- Set and confirm the new password.
- Save the changes.
Update application configuration files to match the new credentials.
Renaming a user
- Open Manage My Databases.
- Under Current Users, click Rename next to the user.
- Enter the new name and proceed.
Deleting a user
Deleting a user removes all database privileges for that user.
- Open Manage My Databases.
- Under Current Users, click Delete.
- Confirm the deletion.
Ensure no applications rely on the user before removal.
Managing databases
After creating users, create databases and assign appropriate privileges.
Creating a database
- Open Manage My Databases.
- Under Create New Database, enter a database name.
- Click Create Database.
Database names are automatically prefixed with your account username.
Adding a user to a database
- Under Add User to Database, select a user.
- Select the target database.
- Click Add.
- Assign specific privileges or select ALL PRIVILEGES.
- Click Make Changes.
[Screenshot placeholder: Assign User Privileges]
Checking and repairing a database
- Under Modify Databases, select a database in Check Database.
- Click Check Database.
- If issues are found, select the database under Repair Database.
- Click Repair Database.
Revoking user privileges
- Under Current Databases, locate the database.
- Click the remove icon next to the user.
- Confirm Revoke User Privileges from Database.
Deleting a database
Deleting a database permanently removes its data.
- Open Manage My Databases.
- Under Current Databases, click Delete next to the database.
- Confirm the deletion.
Create a backup before deletion if data retention is required.
Scaling and operational considerations
For applications with higher load, larger datasets, or custom backup strategies, environments such as cloud servers or a dedicated server provide greater control over database performance, access, and recovery options.