A Database And A Database User Are Different
Creating a database does not automatically give an application permission to use it. You normally create the database, create a database user, and then assign that user to the database with the required privileges.
Create The Database
Open MySQL Databases in cPanel. Enter a short descriptive name and create it. cPanel may add the hosting account username as a prefix.
Create A Dedicated User
Create a database user with a strong unique password. Avoid reusing the main cPanel password. Using separate users for separate applications can make access easier to manage.
Assign The User
Add the new user to the correct database. Most web applications need all standard privileges for their own database, but do not grant access to unrelated databases.
Use The Correct Connection Details
- Database name
- Database username
- Database password
- Database host, commonly localhost
Store Credentials Securely
Applications usually keep database credentials in a configuration file. Protect that file, avoid placing it in public downloads, and do not email credentials in plain text.
Use phpMyAdmin Carefully
phpMyAdmin can import, export, edit, and delete data. Export a backup before running large changes or SQL commands you have not tested.
Remove Old Access
When an application is removed, delete unused database users and databases after confirming the data is no longer needed.