Pre-requirements
- Access to your cPanel account.
- Valid database name and user credentials.
Why You Shouldn't Use phpMyAdmin for Database Creation
cPanel recommend that you avoid using phpMyAdmin to create databases or database users. phpMyAdmin doesn't map databases correctly, which can cause issues with backups and restorations. Instead, use the MySQL Database Wizard or PostgreSQL Database Wizard in cPanel for setting up databases, users, and privileges.
Steps to Create a MySQL Database and User Using the MySQL Database Wizard
- Log in to your cPanel account.
- In the Databases section, click on MySQL Database Wizard.
- In the New Database text box, enter a name for your database, then click Next Step.
- In the Username text box, enter a name for the user who will manage the database.
- Enter and confirm the user’s password.
- Click Create User.
- Select the privileges you want to assign to the user, or select ALL PRIVILEGES.
- Click Next Step. You will see a confirmation message that the database and user account have been successfully created.
Steps to Manually Create a MySQL Database Using MySQL Databases
- Log in to your cPanel account.
- In the Databases section, click on MySQL Databases.
- Under Create New Database, enter the name of the database, then click Create Database.
- After the database is created, click Go Back.
- Under Add User to Database, select the user and the database, then click Add.
- Assign user privileges by selecting specific permissions or ALL PRIVILEGES, then click Make Changes.
Note:
cPanel automatically adds the user to the database during the creation process using the MySQL Database Wizard, so you don't need to manually assign the user unless you're using the manual method.
Gotchas to Avoid
- Always use the MySQL Database Wizard or MySQL Databases interface in cPanel instead of phpMyAdmin for database creation and management.
Importing a MySQL Database Using phpMyAdmin
- Log in to your cPanel account and scroll to the Databases section.
- Click on the phpMyAdmin icon.
- In phpMyAdmin, select the database you want to import data into.
- Click on the Import tab.
- Click the Choose File button and select the compressed SQL file from your local machine.
- Ensure that SQL is selected as the format, then click Go.
Gotchas to Avoid
- If your SQL file exceeds 2MB, compress it using a tool like zip utility before importing.
Alternative: Use Our 1-Click App Installer
Our platform offers over 450 web applications and scripts that you can install using our 1-click app installer, which automatically handles database creation and application setup for you. This is a hassle-free way to install applications like WordPress, Joomla, and more.
To learn more about our 1-click installer, visit our documentation page: WebHostingM Softaculous Docs.
To avoid issues with backups and restorations, we recommend using the MySQL Database Wizard in cPanel rather than phpMyAdmin for database creation and user management. For application installs, consider using our 1-click installer to simplify the setup process. If you need help with your database management, reach out to our support team or follow the steps provided in this guide.
If you'd like to contribute to this tutorial or found an error, email us at team+editorial@webhostingm.com.