How to Create a Database and Database User in cPanel
Step 1: Log in to cPanel
- Open your web browser and navigate to your hosting provider's cPanel login page.
- Enter your cPanel username and password.
- Click Log In.
Step 2: Create a New Database
- Once logged in, locate and click on the Manage My Databases icon in the Databases section.
-
In the Create New Database field, enter a name for your new database.
- Click Create Database.
- A confirmation message will appear, indicating that the database has been created successfully.
Step 3: Create a New Database User
- On the Manage My Databases page, scroll down to the Database Users section.
- Enter a username and a secure password in the Username and Password fields.
- Click Create User.
- A confirmation message will appear, indicating that the user has been created.
Step 4: Link the User to the Database
- Scroll down to the Add User to Database section on the same Manage My Databases page.
- From the User dropdown, select the user you just created.
- From the Database dropdown, select the database you just created.
- Click Add.
- You will be redirected to the Manage User Privileges page. Check the box next to ALL PRIVILEGES to grant the user full access, or select specific privileges as needed.
- Click Make Changes to save.
Step 5: Manage User Privileges
- To modify privileges for an existing user, scroll to the Current Databases section on the MySQL Databases page.
- Under the Privileged Users column, click the name of the user you wish to modify.
- Select or deselect the privileges you want to assign or remove.
- Click Make Changes to save the changes.
Conclusion: By following these steps, you can create a database, add a new user, and manage their privileges effectively in cPanel.