Logo
Bearhost Logo

Create and Manage MySQL Databases

By Elliot, BearHost·

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)

  1. Log in to cPanel
  2. Click MySQL Database Wizard
  3. Enter a database name
  4. Click Next Step
  5. Enter a username and password
  6. Click Create User
  7. Select All Privileges
  8. Click Next Step
  9. Done! Note your database details.

Using MySQL Databases

  1. Click MySQL Databases
  2. Enter database name under "Create New Database"
  3. Click Create Database
  4. Scroll to "Add New User"
  5. Enter username and password
  6. Click Create User
  7. Under "Add User To Database," select user and database
  8. Click Add
  9. Select privileges (usually "All Privileges")
  10. 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

  1. In cPanel, click phpMyAdmin
  2. Select your database from the left sidebar
  3. You can:
    • Browse tables and data
    • Run SQL queries
    • Import/export data
    • Modify table structure

Import a Database

  1. Open phpMyAdmin
  2. Select your database
  3. Click Import
  4. Choose your .sql file
  5. Click Go

Export a Database

  1. Open phpMyAdmin
  2. Select your database
  3. Click Export
  4. Choose format (SQL recommended)
  5. Click Go
  6. 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