Managing MySQL databases and users in cPanel

Most modern web applications — WordPress, Joomla, Drupal, Magento, custom apps — need a MySQL database. cPanel's database tools handle creation, user management, and access control without ever touching the command line. This article walks through the fundamentals and the gotchas.

Conceptual model: databases vs. users

A database is the container for tables and data. A user is a credential that can connect to one or more databases. Best practice: one database per application, one dedicated user per database, never share users across applications.

cPanel prefixes everything with your account name. If your cPanel username is acme, your databases will be named like acme_wordpress and your users like acme_wpuser. The prefix is automatic and required.

Create a database

  1. cPanel → MySQL Databases (under "Databases").
  2. Under Create New Database, enter the database name (just the part after the underscore prefix).
  3. Click Create Database.

Create a database user

  1. Same page, scroll down to MySQL Users.
  2. Enter username and password. Use the password generator — ~16 characters of mixed case, digits, and symbols.
  3. Click Create User.

Save the password before clicking elsewhere. cPanel doesn't let you retrieve it later; you can only reset it.

Grant the user access to the database

  1. Scroll to Add User To Database.
  2. Pick the user and database from the dropdowns.
  3. Click Add.
  4. On the privileges page, tick ALL PRIVILEGES (the only sensible default for an application database).
  5. Click Make Changes.

Now the user can connect to the database. The connection details for your application:

  • Database host: localhost
  • Database name: cpanelusername_dbname (with the prefix)
  • Database user: cpanelusername_username (with the prefix)
  • Database password: what you saved earlier

Alternative: Use phpMyAdmin instead

If you'd rather skip the cPanel UI and work directly with the database (importing a SQL file, editing a table, running queries), phpMyAdmin is the answer. cPanel includes it; click phpMyAdmin from the Databases section. We have a separate phpMyAdmin guide.

Connect from outside cPanel (remote MySQL)

By default, MySQL only accepts connections from localhost — your applications running on the same server. If you need to connect from your laptop, a CI/CD pipeline, or another server:

  1. cPanel → Remote MySQL.
  2. Enter the IP that needs access.
  3. Click Add Host.

You can also use a wildcard pattern like %.yourcompany.com, but be cautious — broadening access widens the attack surface. Use SSH tunneling instead when possible (connect via SSH, forward MySQL's port to your local machine).

Backup a database

Three options, in order of complexity:

Option A: cPanel's Backup tool

cPanel → Backup → under "Download a MySQL Database Backup", click the database name. Downloads a .sql.gz file. Detail in our backups article.

Option B: phpMyAdmin export

Open phpMyAdmin, select the database, click Export, accept defaults (Quick + SQL), click Export. Downloads a .sql file directly.

Option C: Command line (if you have SSH)

$ mysqldump -u username -p databasename > backup.sql.gz

Useful for cron-driven nightly database backups.

Restore a database

  1. If the database doesn't exist yet, create it via cPanel's MySQL Databases tool.
  2. Open phpMyAdmin and select the (empty) target database.
  3. Click Import → pick the .sql file → click Go.

For files over 50 MB, phpMyAdmin times out. Either split the file (use a tool like BigDump) or restore via SSH:

$ mysql -u username -p databasename < backup.sql

Database limits

Your hosting plan limits how many databases you can have:

  • IronHOST: 5 databases
  • BronzeHOST: 25 databases
  • CopperHOST and up: unlimited databases

If you need to consolidate, applications generally don't share databases well; better to upgrade the plan than try to cram multiple apps into one schema.

Common pitfalls

  • "Access denied for user." The user wasn't added to the database, or the privileges were saved without ALL PRIVILEGES ticked. Re-check.
  • "Connection refused." You're using 127.0.0.1 in your config when cPanel expects localhost. Use localhost.
  • Forgot the password. cPanel can't recover it. Reset via Change Password next to the user, then update your application's config file.
  • Using the cPanel master credentials. Your cPanel login cannot connect to MySQL directly — you have to create a separate MySQL user. This trips up everyone the first time.
  • MySQL, database, cPanel, phpMyAdmin
  • 0 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

Nameservers

The nameservers to use for our webhosting services are below: all1.dnsroundrobin.net...

Setting up Dynamic DNS in cPanel

cPanel includes a built-in Dynamic DNS feature that automatically keeps an A record pointed at a...

Setting up Cloudflare with cPanel: the right way

Cloudflare is a free CDN and DDoS-protection service that sits in front of your ipxcore cPanel...

Speeding up WordPress on cPanel hosting

A slow WordPress site costs you visitors, conversions, and search rankings — Google has...

How to migrate your website to ipxcore from another host

Migrating an existing website to ipxcore is a process we've helped thousands of customers...