All tags
database
Narrow down
Other tips98
- Tip
\gexec\gexec runs the SQL that a psql query just generatedTakes every value a query returns and executes it as its own SQL statement.2 Dec 2026 - Tip
PRAGMA table_list;PRAGMA table_list shows every table and view with its column countLists all tables and views of a SQLite database with type, column count and strict flag.2 Dec 2026 - Tip
SELECT unixepoch('2026-01-01 00:00:00');SQLite unixepoch() turns any date string into Unix secondsConverts a date or time string into a Unix timestamp directly in SQL.2 Dec 2026 - Tip
SELECT name, iif(qty > 0, 'in stock', 'sold out') AS stateSQLite iif() is a short CASE expression with several branchesPicks a value based on conditions, without writing a full CASE expression.2 Dec 2026 - Tip
FROM pg_settingsPg_settings.pending_restart lists PostgreSQL changes that still need a restartShows which edited settings in the config file are not active yet because the server has to restart.2 Dec 2026 - Tip
mysqlshowmysqlshow lists databases, tables and columns without opening a clientShows databases, tables or columns from the command line, with optional index and row counts.2 Dec 2026 - Tip
FROM pg_hba_file_rulesPg_hba_file_rules shows PostgreSQL login rules and the line that is brokenLists the rules in pg_hba.conf as rows, with an error message for lines that cannot be parsed.2 Dec 2026 - Tip
LOAD 'auto_explain';Auto_explain writes the plan of slow PostgreSQL queries to the logA contrib module that logs the execution plan of any statement slower than a limit you set.2 Dec 2026 - Tip
FOR UPDATE SKIP LOCKED;MySQL FOR UPDATE SKIP LOCKED lets workers grab different rowsMakes a locking read skip rows that another transaction has locked, instead of waiting.2 Dec 2026 - Tip
CREATE EXTENSION pgstattuple;Pgstattuple_approx estimates PostgreSQL table bloat without reading the whole tableReports dead tuples and free space of a table, skipping pages that the visibility map marks clean.2 Dec 2026 - Tip
ALTER TABLE t ADD COLUMN z INT INVISIBLE;MariaDB INVISIBLE columns stay out of SELECT * and plain INSERTsHides a column from SELECT * and from inserts that do not name it.2 Dec 2026 - Tip
CREATE SEQUENCE s START WITH 100 INCREMENT BY 10;MariaDB CREATE SEQUENCE gives you numbers without AUTO_INCREMENTCreates a sequence object that hands out numbers, usable as a column default.2 Dec 2026 - Tip
CREATE OR REPLACE TABLE scratch (MariaDB CREATE OR REPLACE TABLE rebuilds a table in one statementCreates a table, replacing it if it already exists, so reruns of a script do not fail.2 Dec 2026 - Tip
FROM pg_stat_user_indexesPg_stat_user_indexes idx_scan = 0 points at PostgreSQL indexes nobody usesLists indexes with zero scans since the statistics were last reset, so you can review them for removal.2 Dec 2026 - Tip
mariadb --init-command="SET SESSION sql_mode='STRICT_ALL_TABLES'" mydbmariadb --init-command runs a statement every time you connectRuns one SQL statement automatically after the client connects, and again after a reconnect.2 Dec 2026 - Tip
EXPLAIN (SETTINGS) SELECT * FROM my_table WHERE id = 42;EXPLAIN (SETTINGS) lists the planner settings that differ from the defaultsAdds a line to the plan with every planner-related setting that has a non-default value.2 Dec 2026 - Tip
mariadb-admin -u root -p extended-status --relative --sleep=10 \mariadb-admin in relative mode shows what the server is doing right nowTurns ever growing server counters into per interval numbers.1 Dec 2026 - Tip
ALTER USER 'app'@'localhost' ACCOUNT LOCK;Lock a MariaDB account for a while instead of dropping itBlocks logins for a user while keeping its password and grants.1 Dec 2026 - Tip
SHOW FULL PROCESSLIST;SHOW EXPLAIN shows the plan of a query that is still running in MariaDBReveals how a slow query is executing without waiting for it to finish.1 Dec 2026 - Tip
CREATE TABLE prices (A system versioned MariaDB table remembers every earlier rowLets you query what the data looked like at an earlier moment.1 Dec 2026 - Tip
my_print_defaults --mysqldmy_print_defaults shows which options your MariaDB server reads from filesShows which settings are picked up from all the option files together.1 Dec 2026 - Tip
mariadb --show-warnings -u root -p shop < data.sqlMake the mariadb client print warnings during an importSurfaces truncated and altered values that a quiet import would hide.1 Dec 2026 - Tip
mysql_config_editor set --login-path=shop \mysql_config_editor saves login details under a login pathStores host, user and password so you stop typing them in commands.1 Dec 2026 - Tip
SET PERSIST max_connections = 300;SET PERSIST changes a MySQL setting now and keeps it after restartApplies a server setting immediately without editing a config file.1 Dec 2026 - Tip
ALTER TABLE orders ADD COLUMN note VARCHAR(100), ALGORITHM=INSTANT;Ask MySQL for ALGORITHM=INSTANT so ALTER TABLE never rebuilds silentlyMakes a schema change fail fast instead of starting a long table rebuild.1 Dec 2026 - Tip
SELECT * FROM sys.schema_unused_indexesMySQL's sys.schema_unused_indexes view lists indexes nothing has usedFinds candidates for removal that only slow down writes.1 Dec 2026 - Tip
mariadb -e 'CREATE DATABASE IF NOT EXISTS blog'The one-database option of mariadb restores a single database from a full dumpPulls one database out of a full server dump without touching the others.30 Nov 2026 - Tip
sqlite3 -bail app.db < migrate.sqlsqlite3 -bail stops a SQLite script at the first errorMakes a SQL script stop at the first failing statement instead of running the rest.30 Nov 2026 - Tip
mariadb-dump --no-create-info --insert-ignore shop orders > orders-rows.sqlA mariadb-dump with INSERT IGNORE and no CREATE merges rows into a live database tableDumps only rows as INSERT IGNORE, so loading them adds missing rows and keeps the rest.30 Nov 2026 - Tip
SELECT table_schema, table_name,One information_schema query lists the biggest tables in your database serverShows which tables use the most disk space, data and indexes together, in megabytes.30 Nov 2026 - Tip
CHECKSUM TABLE shop.orders;CHECKSUM TABLE tells you whether two database copies of a table hold the same rowsCompares a table on two servers with one number instead of dumping and diffing it.30 Nov 2026 - Tip
pg_dump -s -f prod-schema.sql -h db1.example.com appdbpg_dump -s dumps only the PostgreSQL schema so you can diff two serversWrites table, index and function definitions without any rows, ready to compare or keep in git.30 Nov 2026 - Tip
SHOW TABLE STATUS LIKE 'orders'\GData_free in SHOW TABLE STATUS tells you whether OPTIMIZE TABLE will shrink a database tableChecks how much reclaimable space a table holds before rebuilding it to shrink it.30 Nov 2026 - Tip
\pset null '(null)'\pset null makes NULL visible in psql so it stops looking like an empty PostgreSQL stringPrints a marker for NULL values so you can tell them apart from empty text.30 Nov 2026 - Tip
MariaDB [shop]> tee /tmp/fix-orders.logTee in the mariadb client logs your whole database session to a fileRecords every query and result of an interactive session in a log file.30 Nov 2026 - Tip
sqlite> .once users.csv.once sends the next SQLite query result to a file and then stopsWrites one query result to a file from inside the shell, then output goes back to the screen.30 Nov 2026 - Tip
DELETE FROM users WHERE active = 0 RETURNING id, email;RETURNING gives you the rows a SQLite INSERT, UPDATE or DELETE touchedGets back ids and values of changed rows from the same statement that changed them.30 Nov 2026 - Tip
MariaDB [shop]> pager less -SPager less -S in the mariadb client keeps wide database tables readableSends query output through less without line wrapping, so wide tables stay aligned.30 Nov 2026 - Tip
CREATE TABLE readings (id int, sensor int, taken_at timestamptz, value numeric);Generate_series fills a PostgreSQL table with test rows in one INSERTCreates thousands of realistic test rows with one statement to try an index or a query.30 Nov 2026 - Tip
sqlite3 app.db "PRAGMA auto_vacuum = INCREMENTAL; VACUUM;"Auto_vacuum INCREMENTAL lets SQLite give space back in small stepsSets a SQLite file up so you can return free pages to disk without a full VACUUM.30 Nov 2026 - Tip
sqlite3 app.db "PRAGMA wal_checkpoint(TRUNCATE);"PRAGMA wal_checkpoint(TRUNCATE) shrinks a SQLite -wal file that keeps growingMoves everything from the write-ahead log into the main file and resets the log to zero bytes.30 Nov 2026 - Tip
sqlite3 app.db ".sha3sum".sha3sum in the sqlite3 shell compares the content of two SQLite filesHashes the rows of a SQLite file so two copies can be compared regardless of file layout.30 Nov 2026 - Tip
ANALYZE SELECT * FROM orders WHERE customer = 'ann';ANALYZE SELECT runs the query and shows real row counts next to the database estimatesRuns a query and prints the plan with actual rows read beside the optimizer's guess.30 Nov 2026 - Tip
sqlite3 app.db ".dump users" > users.sql.dump with a table name exports one SQLite table as SQLWrites the CREATE and INSERT statements for just one table to move it to another file.30 Nov 2026 - Tip
email TEXT COLLATE NOCASE UNIQUECOLLATE NOCASE on a SQLite column makes email lookups ignore caseDeclares a column case-insensitive so comparisons, uniqueness and its index ignore case.30 Nov 2026 - Tip
sqlite3 -header app.db "SELECT * FROM pragma_page_count, pragma_freelist_count, pragma_page_size;"PRAGMA freelist_count tells you how much a SQLite VACUUM would give backChecks how many empty pages a SQLite file holds before you rebuild it.30 Nov 2026 - Tip
SET STATEMENT max_statement_time = 5 FORMax_statement_time stops a runaway database query after a set number of secondsSets a time limit so a slow query is aborted instead of running for hours.30 Nov 2026 - Tip
state, wait_event_type, left(query, 60) AS queryPg_blocking_pids shows which PostgreSQL session is blocking your queryLists waiting sessions together with the process IDs that hold the lock they need.30 Nov 2026 - Tip
SELECT prefs ->> 'theme', prefs -> 'theme', prefs ->> '$.lang'The ->> operator reads a value from JSON in SQLite without json_extractPulls fields out of a JSON column with short arrow syntax instead of function calls.30 Nov 2026 - Tip
INSERT INTO counter VALUES ('home', 1)INSERT … ON CONFLICT DO UPDATE is the SQLite upsert in one statementInserts a row or updates the existing one in a single statement, without a SELECT first.30 Nov 2026 - Tip
ALTER TABLE orders ALTER INDEX idx_customer IGNORED;An IGNORED index lets you test dropping a database index without dropping itHides an index from the optimizer so you can see what breaks before you drop it.30 Nov 2026 - Tip
sqlite> .parameter set :mail '[email protected]'.parameter set lets you test SQLite queries with named parameters in the shellBinds values to :name placeholders so you can run an app's query exactly as written.30 Nov 2026 - Tip
SHOW CREATE TABLE orders\GSHOW CREATE TABLE gives you the exact statement that rebuilds a database tablePrints a complete CREATE TABLE statement with keys, engine and charset for one table.30 Nov 2026 - Tip
sqlite> ATTACH 'old.db' AS old;ATTACH lets one SQLite session query and copy across two filesOpens a second SQLite file under a name so you can join or copy between both.30 Nov 2026 - Tip
SHOW SESSION STATUS LIKE 'Handler_read%';Handler_read_rnd_next shows when a database query reads the whole tableCounts the rows a query actually read, so full table scans stand out right away.30 Nov 2026 - Tip
CREATE VIRTUAL TABLE notes USING fts5(title, body);An FTS5 table gives SQLite real full-text search with rankingSearches text by words and prefixes with ranked results instead of slow LIKE scans.30 Nov 2026 - Tip
mariadb --prompt='\u@\h [\d]> ' shopA custom mariadb prompt shows user, host and database before you run a queryPuts the login user, server host and current database in the client prompt.30 Nov 2026 - Tip
SELECT pid, now() - query_start AS running, left(query, 60)Pg_cancel_backend stops a PostgreSQL query, pg_terminate_backend ends the sessionPicks the gentle or the hard way to stop a runaway query from another session.30 Nov 2026 - Tip
appdb=# \e\e in psql opens your last PostgreSQL query in an editorEdits a long query in your own editor and runs it when you save and quit.30 Nov 2026 - Tip
psql -E -d mydbpsql -E shows the SQL behind \d commands, and noexec only shows itPrints the SQL that psql sends for backslash commands like \dt.28 Nov 2026 - Tip
mariadb --auto-vertical-output -u root -p appdbmariadb --auto-vertical-output switches wide results to one field per lineMakes the MariaDB client print wide query results vertically, one column per line.28 Nov 2026 - Tip
\gset\gset stores a one-row query result in psql variables you can reuseStores the single row of a query result in psql variables for later statements.28 Nov 2026 - Tip
\sf+ my_function\sf+ prints a PostgreSQL function with line numbers so you can find the failing lineShows the source of a PostgreSQL function with numbered lines, to match an error message.28 Nov 2026 - Tip
pg_restore --clean --if-exists -d appdb appdb.dumppg_restore --clean --if-exists overwrites a database without a wall of errorsDrops existing objects before a restore and skips the errors for objects that were never there.28 Nov 2026 - Tip
pg_restore -j 4 -d appdb appdb.dumppg_restore -j restores a large PostgreSQL dump with several parallel jobsRestores a PostgreSQL archive dump using several concurrent jobs so large restores finish sooner.28 Nov 2026 - Tip
psql -1 -v ON_ERROR_STOP=1 -d appdb -f migrate.sqlpsql -1 with ON_ERROR_STOP makes a SQL script all or nothingRuns a SQL script as one transaction and stops at the first error, rolling everything back.28 Nov 2026 - Tip
\copy (SELECT id, email FROM users WHERE active) TO 'users.csv' WITH (FORMAT csv, HEADER)Psql \copy (query) to csv exports a result as CSV on your own machineWrites a query result to a CSV file on your own computer, without server file permissions.28 Nov 2026 - Tip
sqlite3 broken.db ".recover" | sqlite3 recovered.dbsqlite3 .recover rescues rows from a corrupt database where .dump gives upRebuilds a new SQLite database from every readable page of a damaged file.28 Nov 2026 - Tip
sqlite> PRAGMA foreign_keys = ON;PRAGMA foreign_keys = ON makes SQLite actually enforce foreign keysTurns on foreign key enforcement for a SQLite connection, since it is off by default.28 Nov 2026 - Tip
sqlite> PRAGMA busy_timeout = 5000;PRAGMA busy_timeout makes SQLite wait for a lock instead of failing at onceSets how long a SQLite connection waits for a locked database before it reports an error.28 Nov 2026 - Tip
sqlite3 app.db "PRAGMA optimize;"PRAGMA optimize lets SQLite refresh its statistics only where it needs toUpdates SQLite's query planner statistics only for tables where that is likely to help.28 Nov 2026 - Tip
sqlite> .expertsqlite3 .expert suggests the index a slow query is missingProposes missing indexes for a query you type in the SQLite shell.28 Nov 2026 - Tip
sqlite3 app.db "PRAGMA user_version = 3;"PRAGMA user_version gives a SQLite file a built-in schema version numberReads or sets a free integer in the SQLite file header, handy for tracking the schema version.28 Nov 2026 - Tip
mariadb-check -u root -p --all-databases --check-only-changedmariadb-check --check-only-changed checks all tables from the command lineChecks every MariaDB table from the shell, optionally only those changed since the last check.28 Nov 2026 - Tip
mariadb -B -N -e "SELECT id, email FROM users WHERE active" appdbmariadb -B -N -e prints query results as bare tab-separated rows for scriptsRuns one query and prints plain tab-separated rows without borders or a header line.28 Nov 2026 - Tip
psql -X -d appdb -f report.sqlpsql -X skips your ~/.psqlrc so a script behaves the same everywhereStarts psql without reading startup files, so scripts give the same output on every machine.28 Nov 2026 - Tip
SELECT DISTINCT ON (sensor_id) sensor_id, recorded_at, temperatureSELECT DISTINCT ON gives you the newest row per group in PostgreSQLReturns one row per group, such as the latest reading of each sensor, without a subquery.27 Nov 2026 - Tip
\set ON_ERROR_ROLLBACK interactive\set ON_ERROR_ROLLBACK interactive keeps a psql transaction alive after a typoKeeps an open psql transaction usable after one statement fails, instead of aborting all of it.27 Nov 2026 - Tip
sqlite3 app.db "PRAGMA journal_mode=WAL;"PRAGMA journal_mode=WAL lets SQLite read and write at the same timeSwitches a SQLite database to write-ahead logging, so readers and a writer stop blocking each other.27 Nov 2026 - Tip
CREATE TABLE readings (STRICT tables make SQLite reject the wrong data typeMakes a SQLite table refuse values that don't match the column's declared type.27 Nov 2026 - Tip
.timer on.timer on makes the sqlite3 shell show how long each query tookPrints the time each statement took in the sqlite3 shell, so you can compare queries.27 Nov 2026 - Tip
mysql --safe-updates -u root -pmysql --safe-updates stops UPDATE and DELETE without a key or LIMITStarts the mysql client in a mode that refuses UPDATE and DELETE statements that could hit the whole table.25 Nov 2026 - Tip
postgres=# \conninfo\conninfo in psql shows which database, user and host you are onPrints the details of the current psql connection, so you know where a query is about to run.25 Nov 2026 - Tip
sqlite3 -readonly db.sqlitesqlite3 -readonly opens a database without any chance of changing itOpens an SQLite database file in read-only mode, so a stray UPDATE or DELETE just returns an error.25 Nov 2026 - Tip
.mode column.headers on and .mode column make sqlite3 output readableShows sqlite3 query results as aligned columns with their names above them.19 Nov 2026 - Tip
\x auto\x auto lets psql show wide rows one field per lineMakes psql print wide query results one field per line, only when they do not fit.19 Nov 2026 - Tip
redis-cli --bigkeys -i 0.1redis-cli --bigkeys finds the largest keys filling up your cacheScans a Redis instance and reports the biggest keys per type without blocking the server.27 May 2026 - Tip
pg_isready -h 127.0.0.1 -p 5432pg_isready checks whether a PostgreSQL database accepts connections, using an exit codeTests PostgreSQL availability without credentials and returns a script-friendly exit code.4 Mar 2026 - Tip
SHOW GRANTS FOR 'app'@'localhost';SHOW GRANTS FOR checks what a database user can really doLists the exact privileges of one MySQL or MariaDB account so you can spot too-wide rights.3 Mar 2026 - Tip
SET GLOBAL slow_query_log = 'ON';set slow_query_log at runtime to catch slow database queries without a restartStarts logging slow statements on a running MySQL or MariaDB server and shows where the file lives.2 Mar 2026 - Tip
sqlite3 app.db "EXPLAIN QUERY PLAN SELECT * FROM users WHERE email = '[email protected]';"EXPLAIN QUERY PLAN shows whether a SQLite database query uses an indexShows whether SQLite reads a whole table or uses an index for a given query.2 Mar 2026 - Tip
sqlite3 -header -csv app.db "SELECT id, email FROM users" > users.csvsqlite3 -header -csv exports a query result from a database as CSVExports SQLite query results to a CSV file and imports a CSV back with the shell.2 Mar 2026 - Tip
sqlite3 app.db "PRAGMA integrity_check;"PRAGMA integrity_check tells you whether a SQLite database file is damagedVerifies the structure of a SQLite file and reports damage or broken foreign keys.1 Mar 2026 - Tip
FROM pg_stat_user_tables ORDER BY n_dead_tup DESC LIMIT 10;Pg_stat_user_tables shows which database tables autovacuum is behind onFinds the PostgreSQL tables with the most dead rows and shows when they were last cleaned.26 Feb 2026 - Tip
\watch 2Psql \watch repeats a query every few seconds so you can watch a database jobReruns the last PostgreSQL query at a fixed interval inside psql.24 Feb 2026 - Tip
pg_dump -Fc -f appdb.dump appdbpg_dump -Fc makes a compressed database dump that pg_restore can pick apartSaves a PostgreSQL database as a compressed archive from which you can restore only chosen parts.22 Feb 2026 - Tip
EXPLAIN (ANALYZE, BUFFERS) UPDATE orders SET paid = true WHERE id = 42;EXPLAIN (ANALYZE, BUFFERS) shows what a PostgreSQL database query really didRuns a PostgreSQL statement and reports real timings and cache reads for each plan step.22 Feb 2026 - Tip
mysql -e 'SHOW FULL PROCESSLIST'SHOW FULL PROCESSLIST shows the whole query of every running database threadLists every running thread of a MySQL or MariaDB server with its complete SQL text, and lets you stop one.21 Feb 2026
Storage15
- Tip
mysqldump --routines --events mydb > mydb.sqlmysqldump --routines --events keeps stored code in your backupAdds stored procedures, functions and scheduled events to a mysqldump backup.2 Dec 2026 - Tip
pg_dump -O -x -f mydb.sql mydbpg_dump -O -x makes a PostgreSQL dump that any user can restoreLeaves ownership and GRANT statements out of a plain SQL dump, so another user can load it.2 Dec 2026 - Tip
mariadb-dump --skip-extended-insert shop orders > orders.sqlskip-extended-insert puts one row per line so database dumps diff cleanlyWrites one INSERT per row so diff and grep show exactly which rows changed.30 Nov 2026 - Tip
mariadb-dump --databases shop blog > shop-blog.sqlmariadb-dump with the databases option writes CREATE DATABASE into the dump for youMakes a dump that creates and selects its own database when you restore it.30 Nov 2026 - Tip
sqlite3 app.db "VACUUM INTO '/backups/app-compact.db'"VACUUM INTO writes a compact copy of a SQLite database and leaves the original aloneWrites a compact, consistent copy of a SQLite database to a new file.28 Nov 2026 - Tip
pg_dumpall --globals-only -f globals.sqlpg_dumpall --globals-only saves the PostgreSQL roles that pg_dump leaves outDumps only the roles and tablespaces of a PostgreSQL server, which per-database dumps do not contain.28 Nov 2026 - Tip
pg_dump -Fc --exclude-table-data='app_log*' -f appdb.dump appdbpg_dump --exclude-table-data keeps a big log table's structure but skips its rowsDumps a PostgreSQL database but leaves out the rows of chosen tables while keeping their definitions.28 Nov 2026 - Tip
mariadb-dump --single-transaction \mariadb-dump --ignore-table-data keeps a table's structure and leaves out its rowsDumps a MariaDB database but keeps only the structure of the tables you name.28 Nov 2026 - Tip
mariadb-dump --single-transaction --where="created_at >= '2026-01-01'" appdb orders > orders-2026.sqlmariadb-dump --where exports only the rows that match a conditionDumps only the table rows that match a SQL condition instead of the whole table.28 Nov 2026 - Tip
pg_basebackup -D backup -Ft -z -Ppg_basebackup -Ft -z -P takes a physical backup of a whole PostgreSQL serverCopies the data files of a whole running PostgreSQL server into compressed tar files.28 Nov 2026 - Tip
pg_basebackup -h mydbserver -D /usr/local/pgsql/dataPg_verifybackup checks a pg_basebackup copy against its backup manifestVerifies a PostgreSQL base backup against its manifest for missing, extra or damaged files.28 Nov 2026 - Tip
sqlite3 app.db ".backup /backup/app-$(date +%F).db"sqlite3 .backup copies a live database safely where cp can catch it half-writtenMakes a consistent copy of a SQLite database file while it is still in use.27 Feb 2026 - Tip
\dt+Psql \dt+ lists database tables with their size on diskShows disk usage per table, index and database from the psql prompt.25 Feb 2026 - Tip
pg_dump -Fd -j 4 -f /backup/appdb.dir appdbpg_dump -j dumps a large database in parallel, but only in directory formatSpeeds up PostgreSQL dumps and restores by processing several tables at once.22 Feb 2026 - Tip
mysqldump --single-transaction --routines --events mydb | gzip > mydb.sql.gzmysqldump --single-transaction takes a consistent database backup without lockingDumps a MySQL or MariaDB database from one consistent snapshot so applications can keep writing during the backup.21 Feb 2026
Web8
- Tip
wp db query 'SELECT option_value FROM wp_options WHERE option_name="home"' --skip-column-nameswp db query runs SQL with the credentials from wp-configRuns a SQL query against the WordPress database without needing the database password.28 Nov 2026 - Tip
wp db search example.comwp db search finds a string anywhere in the WordPress databaseSearches every WordPress table for a string or regex and shows the table, column and row.28 Nov 2026 - Tip
wp db optimizewp db optimize defragments the WordPress tablesDefragments the WordPress database tables after a big cleanup using the credentials in wp-config.28 Nov 2026 - Tip
define( 'WP_ALLOW_REPAIR', true );WP_ALLOW_REPAIR switches on WordPress's built-in database repair pageTurns on the WordPress database repair page at wp-admin/maint/repair.php, which needs no login.28 Nov 2026 - Tip
wp option pluck my_plugin_settings api timeoutwp option pluck reads one value from deep inside a WordPress optionPrints a single nested value from a WordPress option without dumping the whole array.28 Nov 2026 - Tip
wp post meta list 123wp post meta list shows every custom field of one postPrints all custom fields (post meta) of a single post, optionally filtered by key.28 Nov 2026 - Tip
wp comment delete $(wp comment list --status=spam --format=ids) --forcewp comment delete with --status=spam empties the WordPress spam folder in one goDeletes every comment in the WordPress spam folder permanently with one WP-CLI command.27 Nov 2026 - Tip
wp option list --autoload=on --format=total_byteswp option list --autoload=on --format=total_bytes shows what every page load drags alongShows how many bytes of WordPress options load on every page request, and which ones are biggest.4 Oct 2026
Security3
- Tip
ALTER USER 'appuser'@'192.0.2.10'Rotate a MySQL password without downtime using a second oneLets old and new passwords both work while applications are updated.1 Dec 2026 - Tip
mariadb-backup --backup --target-dir=/backup/full --user=root --passwordmariadb-backup copies the database files of a running server, and prepare makes them usableTakes a fast physical backup of a live MariaDB server instead of a slow SQL dump.30 Nov 2026 - Tip
cat > ~/.my.cnf <<'EOF'A [client] section in ~/.my.cnf keeps the database password off your command lineStores the client login in a private file so commands and cron jobs need no -p.30 Nov 2026
Docker3
- Tip
services:Healthcheck.sh in the MariaDB image checks that the database is really readyUses the check script that ships in the MariaDB image instead of a hand-made mysqladmin line.30 Nov 2026 - Tip
services:MARIADB_AUTO_UPGRADE=1 lets the MariaDB image upgrade the database system tables itselfHas the official image run mariadb-upgrade and back up system tables after a version bump.30 Nov 2026 - Tip
docker exec -it --user www-data nextcloud php occ db:add-missing-indicesOcc db:add-missing-indices clears the missing index warning in NextcloudAdds the database indices Nextcloud expects after an upgrade, so the admin warning disappears.27 Nov 2026
Network2
- Tip
mysqladmin -u root -p pingmysqladmin ping and status give a quick MySQL health checkChecks whether the MySQL server is up and prints a one-line status with uptime, threads and queries.25 Nov 2026 - Tip
wp search-replace 'http://old.example' 'https://new.example' --dry-runwp search-replace --dry-run shows what would change before it touches your databaseCounts the replacements WP-CLI would make in your WordPress database without changing anything.19 Nov 2026
Shell1
Git1
Nothing matches.