CoreCP

Databases and phpMyAdmin

Nearly every website keeps its content in a database: WordPress, a webshop, a forum. This page shows how to create one, who may reach it, and how to look inside.

Written for: Customer, Reseller, Administrator

Nearly every website keeps its content in a database: WordPress, a webshop, a forum. This page shows how to create one, who may reach it, and how to look inside.

Screenshot — Panel → HostingAccounts → your account → Databases. The page has three parts: Databases, Database users and Grants. Screenshots are captured with openwolf designqc into .wolf/designqc-captures/.

Two things, not one

It helps to keep them apart:

  • A database is the cupboard the data sits in.
  • A database user (or login) is the key to that cupboard.

An application always needs both, plus the agreement about who may open which cupboard. That last part is called grants.

Both names automatically get your account name in front. Fill in shop on an account called web1 and the database is called web1_shop. That is not decoration — it is what stops two customers on the same server from claiming each other's database name.

Creating a database

  1. Click Create database.
  2. Fill in a name: letters, digits and underscores only. The account name is already in front.
  3. Click Create.

You get a database and a login of the same name in one go. The password is generated by the server and shown once, on a card with a copy button. CoreCP keeps it nowhere.

corectl db add web1 shop        # creates web1_shop, with login web1_shop
corectl db list
corectl db passwd web1_shop     # a new password, again shown once
corectl db remove web1_shop

This is exactly what wp-config.php or an .env file needs:

DB_NAME     web1_shop
DB_USER     web1_shop
DB_PASSWORD (the password you just saw)
DB_HOST     localhost

localhost is right: applications on the same server talk to the database over a socket, not over the network.

A second login for the same database

Sometimes you want an extra login with fewer rights — a reporting tool that may only read, say. Then you create a login without a database and grant it access afterwards.

  1. Go to Database users and click Create login.
  2. Go to Grants, pick the database and the user, choose read only and click Apply.
corectl db user add web1 reporting                                    # → web1_reporting
corectl db grant web1_shop web1_reporting --account web1 --privileges readonly
corectl db grant list web1_shop --account web1
corectl db revoke web1_shop web1_reporting --account web1
corectl db user remove web1_reporting --account web1

The three levels in the panel:

what it may do
fullread, write, create and drop tables — what an application needs
read onlySELECT only — for reporting, statistics, exports
nonetake the access away again

Opening phpMyAdmin

Click phpMyAdmin on a database. A new tab opens in which you are already signed in as that database's login — you type no password. The ticket behind it is single-use and expires within a minute.

corectl phpmyadmin signon web1        # a single-use sign-on from the command line
corectl webapps status                # is phpMyAdmin served on this node?
corectl webapps set --phpmyadmin on

If you do not see the button, phpMyAdmin is not switched on for this server. That is your hosting provider's choice; ask them about it.

Exporting (making a copy)

With phpMyAdmin — open the database, tab Export, method Quick, format SQL, and click Go. You get one .sql file with everything in it.

In the terminal — the more reliable route for large databases, because a browser cannot stop halfway through:

mysqldump --single-transaction --quick web1_shop | gzip > ~/shop-2026-08-10.sql.gz
ls -lh ~/shop-2026-08-10.sql.gz

--single-transaction makes the export consistent without blocking your site.

Importing (putting a copy back)

With phpMyAdmin — open the database, tab Import, choose your file. Fine up to a few tens of MB; above that the browser hits the upload limit.

In the terminal — no limit:

zcat ~/shop-2026-08-10.sql.gz | mysql web1_shop
# or, if the file is not compressed:
mysql web1_shop < ~/shop.sql

Two things to watch:

  • Importing adds, it does not replace. If you really want the old state back, empty the tables first (in phpMyAdmin: OperationsDrop tables, or import a dump that carries its own DROP TABLE).
  • A dump from another environment usually carries the old web addresses. For WordPress the answer to that is a clone, not a dump — see Making a test environment.

How much are you allowed?

The number of databases comes from your hosting plan; you see it on the account overview. Beyond that the server caps the number of concurrent connections and queries per hour per account, so one busy site cannot flatten the rest.

corectl db limits show web1

If you see "too many connections", it is nearly never a full database — it is an application that does not close its connections properly.

When something is not right

What you seeWhat it usually is
"Access denied for user"Wrong password, or the login has no grant on this database. Look under Grants.
"Unknown database"The name is missing the account prefix. It is web1_shop, not shop.
"Can't connect to local MySQL server"DB_HOST is set to something other than localhost.
The phpMyAdmin button does nothingThe browser blocked the new tab. Allow pop-ups for the panel.
Import stops at "Maximum execution time"The file is too big for the browser. Do it in the terminal.
The database exists but the site says "database connection error"wp-config.php still has the old password. Generate a new one and put it in.

If phpMyAdmin does not open

The Open phpMyAdmin button does the same thing as the webmail button: it asks the server for a one-time ticket and opens a new tab with it. Here too the tab was requested a fraction too late, so the browser refused it and the button appeared to do nothing. That is fixed.

If you do not see the button at all, phpMyAdmin is not installed on the server your account is on. Ask your hosting provider; this is how they check:

ssh root@stck1.corecp.dev 'corectl db phpmyadmin status'
ssh root@stck1.corecp.dev 'corectl db phpmyadmin install'

If the tab still does not open while the button is there, your browser is blocking pop-ups for the panel's address. Allow them for that one address.

See also

  • The web terminal — where mysql and mysqldump run.
  • Your own backups — a backup of your account contains your databases.
  • Installing WordPress — the database is created for you there.