Creating a MySQL Database in cPanel
Most PHP applications (WordPress, Joomla, custom apps) require a MySQL database. Here's how to create one.
Steps
- Log in to cPanel.
- Under Databases, click MySQL Databases.
- Under Create New Database, enter a name for your database (e.g.,
mysite) and click Create Database. The full name will be prefixed with your cPanel username (e.g.,username_mysite). - Scroll down to MySQL Users. Enter a username and a strong password, then click Create User.
- Under Add User to Database, select the user and database you just created, then click Add.
- On the privileges page, click All Privileges then Make Changes.
Connecting Your App to the Database
Use the following connection details in your application's config file:
- Host:
localhost - Database:
cpanelusername_dbname - Username:
cpanelusername_dbuser - Password: the password you set
Managing with phpMyAdmin
In cPanel, click phpMyAdmin under Databases to visually browse and manage your database tables, run SQL queries, import/export data, and more.