How to Create a MySQL Database
cPanel includes a MySQL Database Wizard that walks you through creating a database and a database user in one flow. Once created, you can connect to the database from your web application or enable remote MySQL connections if an external application needs access.
Creating a database with the wizard
- Log in to the cPanel control panel.
- Under the Databases section, click MySQL Database Wizard.
- Enter a name for your database and click Next Step.
- Create a database user by entering a username and a strong password. If you choose to generate a password, copy it somewhere safe before continuing.
- Assign the new user to the database by selecting the appropriate privileges, then click Next Step.
- The wizard confirms the database and user have been created.
Note: Your database name and username are automatically prefixed with your cPanel account identifier followed by an underscore (for example,
accountname_dbname). This is normal and expected.
Connection details
| Setting | Value |
|---|---|
| Host | localhost (for scripts on the same server) |
| Port | 3306 |
| Database | Your full database name (with prefix) |
| Username | Your full database username (with prefix) |
Tip: Most CMS installers such as Softaculous create the database for you automatically. Use the manual wizard when you need a blank database for a custom application.
Troubleshooting
Access denied from an external host: By default, MySQL only accepts connections from the same server. To allow a remote application or tool to connect, see Enabling Remote MySQL Connections.