Databases are essential for many websites and applications, such as WordPress, Joomla, or custom-built sites. cPanel provides tools to easily create and manage MySQL databases and users. This guide will help you get started.
Creating a New Database
- Log in to your cPanel account.
- Scroll down to the Databases section and click on MySQL® Databases.
- Under Create New Database, enter a name for your database.
- Click the Create Database button.
- You will see a confirmation message when the database is successfully created.
Creating a Database User
- In the same MySQL® Databases page, scroll down to Add New User.
- Enter a username for the database user.
- Set a strong password or use the password generator.
- Click Create User.
Assigning a User to a Database
- Scroll down to Add User to Database.
- Select the user you created from the dropdown menu.
- Select the database you want to assign the user to.
- Click Add.
- On the next screen, select the privileges you want to grant the user (usually All Privileges).
- Click Make Changes to save.
Managing Your Databases
- phpMyAdmin: Use phpMyAdmin (accessible from cPanel under the Databases section) to manage your databases, run SQL queries, import/export data, and more.
- Delete Databases: To remove a database, go back to the MySQL® Databases page, find the database under Current Databases, and click Delete.
- Change User Password: Update the password for your database users anytime from the MySQL® Databases page.
Best Practices
- Use strong, unique passwords for your database users to enhance security.
- Regularly back up your databases to avoid data loss.
- Only grant necessary privileges to database users based on their roles.
If you need help managing your databases or have any questions, please contact HostGrap support.