Most web applications require a database. Here's how to create and manage MySQL databases in cPanel.
Create a Database
Using MySQL Database Wizard (Easiest)
- Log in to cPanel
- Click MySQL Database Wizard
- Enter a database name
- Click Next Step
- Enter a username and password
- Click Create User
- Select All Privileges
- Click Next Step
- Done! Note your database details.
Using MySQL Databases
- Click MySQL Databases
- Enter database name under "Create New Database"
- Click Create Database
- Scroll to "Add New User"
- Enter username and password
- Click Create User
- Under "Add User To Database," select user and database
- Click Add
- Select privileges (usually "All Privileges")
- Click Make Changes
Database Credentials
Your application needs these details:
- Database Name: youraccount_dbname
- Username: youraccount_username
- Password: The password you created
- Host: localhost
Manage with phpMyAdmin
- In cPanel, click phpMyAdmin
- Select your database from the left sidebar
- You can:
- Browse tables and data
- Run SQL queries
- Import/export data
- Modify table structure
Import a Database
- Open phpMyAdmin
- Select your database
- Click Import
- Choose your .sql file
- Click Go
Export a Database
- Open phpMyAdmin
- Select your database
- Click Export
- Choose format (SQL recommended)
- Click Go
- Save the downloaded file
Common Issues
Access Denied
- Check username and password
- Ensure user is assigned to database
- Verify localhost as host
Database Too Large to Import
- Import via command line
- Split SQL file into smaller chunks
- Contact support for assistance
Tips
- Use strong passwords for database users
- Create separate databases for each application
- Back up databases regularly
- Don't share database credentials
Tags:#cpanel#database#mysql#phpmyadmin