How do I add a user to a MySQL database?
Whenever you use a PHP software or keep a records collection which has to be accessed often, then creating a database is necessary. After creation of said database, a user and the corresponding credentials need to be created in order to access it.
Usually a type of MySQL database is used. The users of such a database can be managed and accounted for, from PhpMyAdmin option in the cPanel’s Databases section. The necessary credentials for this user have to be created.
Deletion of a script or restarting or creating a new database must be carried out only after deleting the old MySQL database. To delete the database completely without any trace of it, then sometimes deleting the user(s) who were credentialed is also a necessary step.
1. Log in to your cPanel account.
2. Navigate to Databases.
The Database section will be displayed.
3. Click MySQL Databases.
The MySQL Databases page will be displayed.
4. Enter the user name in the Username text entry box.
5. Enter the password in the Password text entry text box.
6. Re-enter the password for confirmation in Password (Again) field.
7. Click Create User.
The user is now created. You can now assign database to this user.
8. In the Add User to Database section, select the User from the dropdown list.
9. Select the database you want to map with the user from the Database dropdown list.
10. Click Add.
Once the user is mapped to the database, you can view that user in the Current Userssection.