WP Instances

Database

Every site has its own MariaDB database on one shared database server. The Database tab (key 5) shows how to connect to it, what's in it and how big it is.

Connection details

Field Value
Database wpx_ plus the site name, with hyphens as underscores. For client-site: wpx_client_site.
User wp
Password wp
Host from this PC 127.0.0.1:3307
Host from the site db:3306 (what wp-config.php uses inside Docker)
Table prefix The site's $table_prefix, usually wp_. A restored backup can change it.

The tab also shows the Server version, the Character set and the total Size. Hover a value to copy it.

3307 is the database port. If another program uses it when WP Instances starts, the database moves to the next free port by itself; the status bar (db :3307) and the Database tab always show the current one. You can also change it in Settings.

The database only accepts connections from this computer.

Connect a database app

TablePlus, HeidiSQL, DBeaver, MySQL Workbench and VS Code extensions all work. Create a MySQL or MariaDB connection with:

Host:     127.0.0.1
Port:     3307
User:     wp
Password: wp
Database: wpx_client_site

phpMyAdmin

Click Open in phpMyAdmin on the Database tab, click the database name on the Overview tab, or press B. phpMyAdmin opens in your browser, already signed in, on this site's database.

The first time, phpMyAdmin is downloaded and started, which takes about 30 seconds. After that it opens right away. It runs at http://127.0.0.1:8082 (the port moves aside if another program has it) and only accepts connections from this computer.

Use it to browse rows, run SQL, and export or import .sql files.

Tables

Tables lists every table with its approximate row count and size, largest first. Filter tables… narrows the list.

"Rows (approx.)" comes from MariaDB's statistics and can be a little off for InnoDB tables. Open the table in phpMyAdmin for an exact count.

Good to know

  • To replace the whole database with a backup, use Import backup on the Overview tab. It also rewrites the live site's addresses and aligns the table prefix. See Importing backups.
  • Deleting a site deletes its database too.
  • The Documentation section at the bottom of the Database tab also has WP-CLI commands to query or export the database.