Creating databases
Create a MySQL database and user in cPanel, connect your app, and use phpMyAdmin.
1 min read Some details need confirmation
On this page
Create a database and user#
- Open MySQL Databases (or the Database Wizard for a guided version).
- Create New Database — cPanel prefixes the name with your username, for example
cpuser_shop. - Add New User with a strong password.
- Add User To Database and grant ALL PRIVILEGES (or only the privileges your app needs).
Connect your application#
| Setting | Value |
|---|---|
| Host | localhost (apps on the same hosting account) |
| Database | cpuser_dbname (the full, prefixed name) |
| Username | cpuser_username (prefixed) |
| Password | The one you set |
WordPress example, in wp-config.php:
php
define( 'DB_NAME', 'cpuser_wp' );
define( 'DB_USER', 'cpuser_wpuser' );
define( 'DB_PASSWORD', 'your-strong-password' );
define( 'DB_HOST', 'localhost' );phpMyAdmin#
Open phpMyAdmin from cPanel to browse tables, run SQL and import or export .sql files.
Remote connections#
Remote database access is closed by default. To connect from another machine, add its IP in Remote MySQL.
Was this page helpful?
