How to Create a MySQL Database
Many web applications — including WordPress and other CMS platforms — need a MySQL database to store their data. This guide walks through creating one in cPanel, creating a database user, and connecting the two. Step...
0 views
Many web applications — including WordPress and other CMS platforms — need a MySQL database to store their data. This guide walks through creating one in cPanel, creating a database user, and connecting the two.
Step 1: Create the Database
- Log in to cPanel.
- Under the Databases section, click MySQL Databases.
- Under "Create New Database," enter a name for your database and click Create Database.
Note that cPanel automatically prefixes your database name with your cPanel username (e.g. username_dbname) — this is normal and required.
Step 2: Create a Database User
- On the same MySQL Databases page, scroll to "MySQL Users" and find Add New User.
- Enter a username and a strong password (or use the password generator), then click Create User.
Like the database name, your username will be prefixed automatically (e.g. username_dbuser).
Step 3: Add the User to the Database
- Scroll to "Add User to Database."
- Select the user and the database you just created, then click Add.
- On the next screen, check All Privileges (unless you specifically need to limit permissions) and click Make Changes.
Step 4: Connect Your Application
Your application (such as WordPress) will ask for the database name, username, password, and host during setup. Use the full prefixed names from above, and enter localhost as the database host unless your application specifies otherwise.
Managing Your Database
You can browse and edit database tables directly using phpMyAdmin, also found in the Databases section of cPanel.
Related Articles
- How to Install WordPress
- Getting Started with cPanel
Was this answer helpful?Your response helps us improve future guides.