Create a MySQL or PostgreSQL database and user
Set up a database, give a user the right privileges and find the connection details for your application.
Most web applications β WordPress, Laravel, custom PHP sites β store their content in a database.
Create a MySQL database
- In cPanel open Databases β Database Wizard.
- Enter a database name. cPanel adds your username as a prefix, for example
acme_shop. - Create a database user with a strong generated password.
- Tick ALL PRIVILEGES (or only the privileges your app needs) and click Next Step.
Connection details
| Setting | Value |
|---|---|
| Host | localhost |
| Database | cpaneluser_dbname |
| Username | cpaneluser_dbuser |
| Port | 3306 (MySQL) or 5432 (PostgreSQL) |
PostgreSQL
Open Databases β PostgreSQL Database Wizard and follow the same steps.
Import an existing database
Open phpMyAdmin, select the empty database, click Import and upload your .sql file. Very large files can be compressed as .sql.gz first.
Was this article helpful?
Your vote helps us write better guides.
