webtimeless

Databases

A site's Database tab: tables and rows, WordPress clean-ups and table health, the SQL runner, top queries, imports and exports, and Undo for each change.

Where
A site's Database tab (?tab=database), and Services, MySQL for every other database
Views
Overview, Tables, SQL, and Backups and tools
Undo
Every change is saved first and can be put back for 14 days
Never sent
Row values never reach the AI assistant or Run history
On this page

A site's Database tab has four views. A WordPress site opens on Overview, any other site on Tables. An old link to the WordPress view opens Overview.

View What it is for
Overview What needs a look first: table health, autoload, transients, clean-ups (WordPress only)
Tables The tables and their rows: browse, filter, change, export
SQL One statement at a time, read only by default
Backups and tools Snapshots, imports, search and replace, clean copies and kept databases

Cards side by side come in pairs of a kind, as tall as each other. Import a database and Search and replace take their whole row. A view's note sits on one line with Check again.

Every other database on the server opens from Services, MySQL with the same Tables and SQL views (/services/mysql?db=<name>). MySQL's own databases and the ones the panel keeps for a site are only read.

Overview

What WordPress keeps in its database, for each site of a network. The view starts with what needs a look, when anything does: one link per card that found something, worst first. That covers table problems, autoload over its limit, expired transients, leftovers of plugins that are gone and rows to clean up. A link scrolls to its card and rings it for two seconds.

How the view reads

  • It shows what the panel read last time at once ("Read 3 h ago" in its bar) and reads the quick parts again.
  • The parts that scan whole tables are read only on Check again, or after a job changed the site. Each fills its card in when it is read, within a minute.
  • Leaving the view stops its reads in MySQL too.
  • A long list shows its first 7 rows and Show all, which this browser remembers per site. Another site's lists open short.
  • A name in a list (an option, a meta key, a post type) opens its table in Tables, filtered on it. The filter's value goes with the page's history, never its address.

Table health

Every table of the site that is not as it should be, once, with its problems in a few words. A lost key comes first.

In What is flagged
WordPress's tables A lost primary key or AUTO_INCREMENT (a bad import's mark: new posts get ID 0), a missing index, MyISAM, utf8mb3
Plugins' and themes' tables MyISAM, marked as not WordPress's
  • Fix on a row fixes everything the panel can on that table. Open the row for each problem in full, with its own fix.
  • Fix all fixes every table in one job, the smallest first. Stop ends it between two tables.
  • Every fix saves the table whole first, so Undo puts it back.
  • A key fix waits while duplicate or zero IDs are there, and says how many.
  • latin1 is only flagged: its text may already hold UTF-8 bytes that a conversion would garble.
  • Room a rebuild gives back (after a clean-up, say) is one line under the list, with Optimize. That is upkeep, not a problem.

Autoloaded options and transients

  • Autoloaded options: the total against Site Health's 800 KB limit, the biggest by name, and Turn off for a big one. It is written the way the site's WordPress writes it: on and off, or yes and no before 6.6.
  • Transients: how many, with the expired ones still stored, and Delete expired or Delete all.

What a clean-up would find

Group What it finds
Posts Revisions, auto-drafts, posts in the trash
Comments Spam, the trash, Akismet's history
Caches and logs oEmbed caches, Action Scheduler's finished, failed and cancelled actions with their logs, expired WooCommerce sessions, saved login sessions, repeated post meta
Left behind by something deleted Meta and terms whose post, comment, term or user is gone
  • Revisions have Keep under the row: all of them go, or all but the newest 1, 3, 5 or 10 of each post.
  • Caches and logs show only where the site has their tables. Saved login sessions start unticked, since everyone signs in again.
  • Repeated post meta needs Look for them, which reads every value of postmeta, within two minutes.
  • Kinds with nothing to clean fold into one line.

Each count opens its rows in Tables with a chip like "Only: spam comments". The server builds it from the clean-up's own condition, so what shows is what the clean-up would delete.

Deleting rows there takes only those rows. The clean-up also takes a post's meta, terms and comments, as WordPress deletes it (a link's terms stay). One Delete the ticked runs every ticked kind as one job, with one Undo.

Post meta by key

The custom fields (meta_key) that fill postmeta, to see what makes it big: a page builder's data, an old plugin's leftovers. Up to 300,000 rows they come by size. On a bigger table they come by rows first, since a size needs every value read; Count sizes reads the sizes anyway.

What plugins and themes keep

The tables that are not WordPress's own, each with what it likely belongs to and whether that is on, off or gone. These are guesses, and the panel says so.

  • A table is matched by its name first: known plugins, then the plugins folder.
  • A table no name explains is looked for in the site's PHP code, as wandworks_log in $wpdb->prefix . 'wandworks_log' or its full name. One grep over the themes, must-use plugins and plugins finds the theme in use, another theme, a must-use plugin (always on) or a plugin by another name.
  • A table nothing in the code names says so.
  • Delete is only for a table whose owner is not in use. You type the name, and the table is saved whole first.

Under the tables: the options a plugin that is off or gone still loads on every page, with Turn off autoload, and posts of types no plugin or theme registers any more (WP-CLI's list, with plugins loaded).

Users and what grows

  • The users with their roles.
  • What grows: the panel notes the site's table sizes once a day when this view opens (30 days, names and sizes only) and shows the tables that grew most since.

How a clean-up or fix runs

Each clean-up and fix is a job that saves what it changes first (see Undo and saved copies). It checks the disk has room for its copy before it starts.

  • A clean-up deletes in batches of 5,000 rows, each its own short transaction, and shows the rows done so far.
  • Stop ends it after the batch it is on. Retry carries on, and Undo puts back what it removed.
  • A job keeps running when you leave the page. Open the view again and it is back in its card; a toast says when one you are not looking at ends.

Tables

The list of tables

  • Every table with its engine, rows and size, with a filter for the site's prefix and other prefixes.
  • Sort by name or biggest first. The sort is remembered with your other view choices, in every browser you sign in from.
  • The list shows the first 21 tables, with Show 21 more and Show all. Find a table and the prefix filters search every table.
  • A table's menu has Empty and Delete, with its name typed to confirm, each saved first.

Rows

  • A table's rows come a page at a time (25 to 250), sorted by any column.
  • Filters: is, contains, starts with, more or less than, NULL. With two or more, pick Match every filter or Match any filter.
  • A row opens with all its values. Long ones load in full on request, and PHP serialized values and JSON show as a tree.

Structure, export and phpMyAdmin

  • Structure: the columns, indexes, CREATE TABLE, and what deserves a look (no primary key, MyISAM, an old character set, free space).
  • Export: the whole database (with its views, routines and events) or the tables you tick, as a .sql.gz streamed from mysqldump with nothing left on disk. It has no CREATE DATABASE or USE, so it imports into any database.
  • Open in phpMyAdmin, on a site Apache serves, when phpMyAdmin is installed.

Change rows

Edit, Duplicate and Delete on a row, Add a row to the table, and tick rows on a page to delete them together.

  • Long values load in full before you edit them. NULL is a tick of its own.
  • The button next to a row's title fills the window, for a row with many columns or long values. It lasts while the dialog is open. Any dialog that scrolls has the same button, and its buttons stay below the columns as they scroll.
  • A change applies only while the row still holds what you saw, so an edit made since is never overwritten.
  • Views, tables without a primary key, binary and computed columns stay read only. A site's rows wait while a job works on it.

Serialized values and NUL bytes

  • A PHP serialized value whose string lengths no longer add up, or JSON that no longer reads, is flagged, with Count the lengths again. A new value that starts like a serialized array or object and does not read is flagged too.
  • A value with NUL bytes or Windows line breaks opens in an editor that shows them (\0, \r) and keeps them as they are. A plain text box would hide the first and turn \r\n into \n.
  • PHP keeps NUL bytes around the names of an object's protected and private properties. When one is deleted, the panel names the property and does not offer to count the lengths again, which would quietly make it public.
  • A NUL byte cannot be typed: \0 typed is a backslash and a zero. Type \0*\0name or \0Class\0name in a property name and click Turn \0 into NUL bytes. Only those spots change, the lengths are counted again, and it is offered only when the value then reads.

Changes you can undo

Each change saves the rows as they were first. Undo, in the toast or under Changes you can undo, puts them back.

  • Each change there says what it changed, such as "Changed option_value of a row".
  • Open it for the row's key and each column before and after. The before is what Undo puts back.
  • Long values are cut there.

Note Undo works for 14 days. The before and after are read from the saved copy when you open the change, in the browser only: they are never kept in Run history or sent to an AI.

SQL

One statement at a time, in a code editor:

  • MySQL's keywords coloured and suggested, the database's own tables as you type, and a table's columns after table..
  • Tab takes a suggestion (Escape then Tab leaves the editor), and Ctrl+Enter runs.
  • Drag the corner of the box to resize it.

What each mode allows

Mode Statements Limits and checks
Read only (default) SELECT, WITH, SHOW, EXPLAIN, DESCRIBE, TABLE, VALUES Runs as the read-only MySQL account; up to 1,000 rows and 30 seconds
Can write Rows: INSERT, UPDATE, DELETE, REPLACE. Tables, indexes, views: ALTER, CREATE, DROP, RENAME, TRUNCATE Check and run first; you type the database's name; a job saves the tables whole, then runs it; Undo puts them back

Check and run shows the rows the statement changes (tried in a transaction that is rolled back, on tables that can roll back), the tables it saves first with their size, and the disk's free room.

The runner never touches another database, accounts, rights, routines or files. A second statement is refused before anything runs.

Explain, CSV and History

  • Explain shows how MySQL would run a statement. CSV downloads the result.
  • History keeps the last 30 statements in this browser, as wide as the editor, with the whole statement on hover.
  • Explain also takes an UPDATE, a DELETE, or an INSERT or REPLACE with a SELECT. MySQL explains those only to an account that may run them, so the panel explains the SELECT that finds the same rows (what makes them slow) and shows it above the plan.
  • An INSERT that lists its rows reads nothing, so it has no plan.

Top queries

On a site's Performance tab, next to its profiles, and for every database at once on Services, MySQL.

Every query the database ran, the most time in all first. A quick query that runs a thousand times on a page can cost more than one slow one, and only a ranking by total time shows it. The list shows the first 21, with Show more.

  • Each row has how many runs, the time in all and each, the slowest run, and rows read against rows sent.
  • missing index? marks a query that reads far more rows than it returns, or ran without an index.
  • A row opens the query whole and one real run of it with its values, shown on request: it can hold data, and it is never stored or sent to an AI.
  • Explain in SQL opens the SQL view with that run and its plan.

Where the numbers come from

  • MySQL 8: MySQL's statement statistics (performance_schema). Always on, every query, nothing to switch on. The slow query log is separate and can stay off.
  • MariaDB, or where those are off: the slow query log. Switching it on in Services, MySQL also sends it to its table (log_output = FILE,TABLE), where the panel reads it. Its limit is 10 seconds by default; 1 second suits local work.

The panel's own reads are left out.

Find a slow page's queries

Start counting again empties both sources, so a page loaded after it shows only its own queries.

  1. Press Start counting again.
  2. Load the slow page.
  3. Press Check again.
  4. Open the top query and press Explain in SQL.

Backups and tools

Card What it does
Snapshots Take, restore and download a snapshot of the site's database
Import a database Every way a copy replaces the site's database (see below)
Clean this database The same clean-up as a cleaned import, on the database the site has now, with no address replaced
Search and replace On groups of tables at once, leaving out tables without the addresses, with a preview
Clean copies A gzipped clean copy for the team, with a check for leftover emails
Kept databases The tables from before an import or clean-up, to put back

What is kept and for how long

Kind Kept
Snapshots the panel takes before an import, a restore, a search and replace or updates The newest 3 per site, and every one from the last 30 days
Snapshots you take Until you delete them
Clean copies Until you delete them
The backups dmp-restore uses Until you delete them
Kept databases 7 days
Copies for Undo (rows, clean-ups, fixes, SQL that writes, deleted databases) 14 days (see Undo and saved copies)

Older snapshots the panel took go once a day. Sanctum's storage list shows the room each kind takes, with Clean up now (see Sanctum).

Import a database

One card for every way a copy replaces the site's database. Whatever the source:

  • The copy goes into a side database and is swapped in at once, with MySQL's limits raised while it runs.
  • Production domains are replaced with the site's: in URLs only, or every mention when you tick it.
  • The tables from before are kept for 7 days under Kept databases.
  • A dump from MariaDB 10.10 or later has its uca1400 collations, which MySQL does not know, turned into unicode_520_ci on the way in, in the structure only.

The copy is one of two:

Copy What comes over
As it is An exact copy, with every user, order and key
Cleaned No users (one administrator you pick stays, as the author of every post), orders, form entries, logs or keys; cleaned with SQL in the side database before anything reaches the site

A dump with views, triggers or routines cannot be cleaned in the side database, so it is imported as it is, straight in after a snapshot.

From a dump takes a .sql, .sql.gz or .zip from any source the new site wizard has: an upload, the Downloads folder, a cloud drive or Drive link, a public URL, a server over SSH (with tables to leave the rows of) or this machine.

Refresh from production

Set up once per site, then one button brings production's database home.

  1. Under Import a database, choose From production.
  2. Give the SSH host (an alias from ~/.ssh/config, or alex@www.spellbook.example), the WordPress folder there, the tables whose rows stay there, and whether the copy is cleaned.
  3. If the server asks for a password, type it under Password on the server. Test password checks it first.
  4. For a cleaned copy, pick the administrator it keeps and type that user's password; both sit by the button. The login is remembered for next time, the password never is.
  5. Press Refresh now. The panel exports production's database over SSH, reading only, and imports it.
  6. Its last step names the plugins and themes the new database uses that the site's files lack. Nothing is fetched on its own: the missing row on the Plugins and themes tab installs or copies them.

On a network the administrator a cleaned copy keeps is a super admin and an administrator of every site.

Note Nothing is written on production, and no key is added there. The settings hold no secret: a password lives only in the panel's secrets.json, and only when you save it.

Change saves another server. Forget removes the saved one, so this, the missing row and Uploads from production ask again; Undo in the toast saves it back.

Passwords and host keys

The panel signs in with your own SSH key, through your agent and your ~/.ssh/config. With a key that works, it says so and asks for nothing.

  • How a server signs you in is checked when you stop typing the host or press Check connection (one connection that runs nothing), and kept for an hour. A site's saved server is not checked when you open a view.
  • Password on the server shows only for a server that would ask for one. A server that refuses your key and takes keys only, or one the panel cannot reach, is said there too.
  • Save for the host keeps the password in the panel's secrets.json, readable by you only. It is never shown back: the field says one is saved, an empty field uses it, a new one replaces it, and Forget password removes it. A run with no typed password uses the saved one, a Retry too.
  • A password you do not save is used for that run's connections only, never logged or shown. A wrong password is tried once.
  • Test password signs in once with the typed password, or the saved one, and runs nothing there. A wrong one shows before a run needs it.
  • A host not in your known_hosts is refused, never trusted on the fly. The panel says what to type in a terminal: answer yes to its key, then press Ctrl+C at the password prompt, since the key is kept by then.

MySQL on the Services page

Like a site's Overview, it starts with what needs a look: databases no site uses and users left behind. Check again works here too: on a database's page, the MySQL settings and Top queries.

  • Databases and users: every one with what it is to the panel (a site's, kept for a site, not used by a site, left behind, MySQL's own), with fresh sizes.
  • Analyze and Optimize. Delete a database or user no site uses, or reset a site's database user. A deleted one is saved first to the panel's MySQL backups for 14 days, so Undo puts it back; Saved copies lists them, with Delete to remove one sooner.
  • Processes: what MySQL runs now, the longest first, with Stop for a statement (never one of MySQL's own threads).
  • Top queries: the same list as a site's, for every site's database at once.
  • Import a dump into a new database, or into one no site uses, which is saved to the MySQL backups first and emptied. The dump's own CREATE DATABASE, DROP DATABASE and USE lines are left out, so it changes no other database.

Settings

The buffer pool, the biggest packet, the redo log, connections, temp tables in memory, how often InnoDB writes to disk and the slow query log. Each shows what it runs at now, what the panel keeps, what an import holds raised for its run, and a suggestion where the value is low (the buffer pool from your sites' InnoDB data).

  • Change, or a suggestion's Use, starts a job. SET GLOBAL applies it at once.
  • dmp-root mysql-config-write keeps it for the next start in zz-devmagic-panel.cnf in mysql.conf.d (or mariadb.conf.d), which MySQL reads last.
  • Only these settings go in, as numbers inside bounds. Clearing one takes it out of the file.
  • The slow query log, when on, goes to its table too, for Top queries where MySQL keeps no statement statistics.
  • Undo puts the values from before back.

Undo and saved copies

Change Saved first to Undo
A row changed, added or deleted ~/devmagic-panel-backups/row-changes/ Puts it back while the row still holds what the change left
A clean-up, an emptied or deleted table ~/devmagic-panel-backups/cleanups/ Puts the rows back; a row made again since stays as it is
A table fix, autoload turned off for options ~/devmagic-panel-backups/cleanups/ Puts the table, or the options, back as they were
SQL that writes ~/devmagic-panel-backups/cleanups/ Puts the tables it names back as they were before it
A replaced or deleted database The panel's MySQL backups Puts the database back

All are readable only by you and go after 14 days. Undo is on the job, in the toast, and under Changes you can undo.

How it stays safe

  • The browser reads in a read-only transaction with a time limit.
  • The SQL runner reads as devmagic_panel_ro, an account with SELECT and SHOW VIEW only, made by the installer or from Aura's Machine checks.
  • Values reach MySQL as hex literals in the column's collation, and names only once MySQL listed them. A filter's value never reaches a URL.
  • Every import runs mysql --binary-mode, so a client command like \! in a dump fails as SQL instead of running.

Note The AI assistant sees a database as names, sizes and counts only, never a value from a row. Run history keeps no row values and no SQL that writes.

Checked against devmagic-panel 1.67.0.

Type to search the docs, guides, comparisons and tool pages.