How to Create and Manage MySQL Databases in cPanel (Step-by-Step Guide)
Most websites today — including WordPress, Joomla, and custom applications — rely on MySQL databases to store data like posts, user info, and settings. If you’re setting up a dynamic website, you’ll likely need at least one database.
In this guide, you’ll learn how to create, manage, and assign users to MySQL databases using cPanel — all without writing a single line of code.
✅ Why MySQL Databases Matter
MySQL databases are used to:
- Store and retrieve website content dynamically
- Power CMS platforms like WordPress, Drupal, Magento, etc.
- Handle login systems, forms, and admin panels
With cPanel, you can manage these databases easily through a visual interface.
🚀 How to Create a MySQL Database in cPanel
Step 1: Log in to cPanel
Access your cPanel at yourdomain.com:2083
or via your hosting dashboard.
Step 2: Open MySQL Databases
Scroll down to the Databases section and click on MySQL Databases.
Step 3: Create a New Database
- In the Create New Database field, enter a name (e.g.,
wordpress_db
). - Click Create Database.
cPanel will automatically prefix your database name with your username (e.g., user_wordpress_db
).
👤 How to Create a Database User
After creating the database, you need a user to access it.
Step 4: Add a New User
- Scroll to the MySQL Users section.
- Enter a username (e.g.,
wpuser
) and a strong password. - Click Create User.
Again, the username will be prefixed (e.g., user_wpuser
).
🔗 Assign User to Database
Step 5: Add User to Database
- In the Add User to Database section:
- Select the user and the database you just created.
- Click Add.
- On the next screen, check ALL PRIVILEGES to grant full access.
- Click Make Changes.
Your database is now ready for use!
🛠️ Managing Databases in cPanel
You can also:
- Rename or delete databases
- Change user privileges
- Repair or check databases
- Use phpMyAdmin to manage tables, import/export data, and run SQL queries
🧠 Pro Tips
- Keep a naming convention (e.g.,
site1_db
,site2_db
) to stay organized. - Use strong passwords for database users — especially on public-facing apps.
- Always back up your database before making changes or updates.
🧩 When Will You Use This?
- Setting up WordPress manually
- Developing custom apps with PHP & MySQL
- Migrating sites from one host to another
- Fixing broken connections or corrupted tables
📌 Final Thoughts
Creating and managing MySQL databases in cPanel is easier than it sounds. With just a few clicks, you’ll be ready to connect your database to WordPress, a custom script, or a CMS.
If you need help setting up or troubleshooting your database, don’t hesitate to reach out to our support team.