Skip to content

Databases

Each site can have its own databases, created on the Databases tab. The engine is MariaDB, which is MySQL-compatible; there is no PostgreSQL and no choice to make.

Databases are reachable from your own site only. Nothing outside can connect, including your workstation, so there is no remote administration client and no phpMyAdmin.

Creating one

You give a short name, and it is strict:

text
Starts with a lowercase letter, then lowercase letters and numbers only (max. 16 characters)

Lowercase letters and digits, nothing else. wordpress and shop2 are fine, wp_main and my-db are not.

That name is a label, not the real database name. The actual database and user names are generated from your site and the label, and both are longer. Always copy the values the portal shows rather than guessing them.

A new database shows Creating... for a few seconds and then Ready. Character set and collation are fixed at utf8mb4 and utf8mb4_unicode_ci.

There is no limit on how many databases a site may have. Their size counts towards the package storage pool like any other data.

Connecting

From your own code, use the environment. Every site has its database credentials in its environment, so nothing has to be written into a file that ends up in a repository:

VariableContents
DB_HOST, DB_PORTHost and port of the first database
DB_NAME, DB_USER, DB_PASSWORDIts database name, user and password
DB_<LABEL>_HOST and so onThe same five for each database, by label

DB_HOST and friends point at the first database on the site. With more than one, use the labelled form, for example DB_SHOP_NAME.

For applications that want them in a config file, expand the database row, use Show credentials to read host, port, database, username and password, or Config snippet to get them formatted for .env, WordPress, Laravel or plain PHP.

There is no mysql command in the console

The command line clients are not installed, so mysql, mysqldump and everything that shells out to them fail. That includes wp db export, wp db import and wp db cli.

For a dump, create a backup and download the SQL file. For queries, use your framework's own tooling, such as php artisan tinker or wp eval, which talk to the database through PHP.

Connection limits

Each database user may hold 50 connections at once. A site serves at most 15 PHP requests in parallel, so normal traffic does not come close, even with persistent connections. Console and cron runs each add one or two on top.

If you do hit it, the driver reports MariaDB's own message. The realistic cause is an application opening connections in a loop without closing them, not the limit being too low.

Rotating the password

Rotate password on the database row replaces the password. The portal asks first:

text
Are you sure? The current password will be invalidated and your application must be updated.

Take that literally:

  • The old password stops working immediately.
  • The new password is not shown by the rotation itself. Wait a few seconds, then use Show credentials to read it.
  • The database user is briefly absent while it is recreated, so connections fail for a moment even with the right password.
  • Anything holding the credentials in a file, wp-config.php, .env, a framework config, keeps the old password and stays broken until you update it.

Applications reading DB_PASSWORD from the environment pick the new value up on the next site restart.

Deleting

Deleting a database from the tab destroys it:

text
Are you sure? The database and all data will be permanently deleted.

There is no soft delete, no grace period, and no backup is taken first. If you might want the data, create a backup and download the SQL file before you delete. The same applies to deleting the whole site.

What's next