Operations

WordPress

Moving a WordPress site between domains and fixing MySQL bind errors.

3 tasks

This page is a scrubbed, public-safe version of an internal AI/SI operations runbook — the command cheat-sheet a systems engineer builds up over years of running Linux servers, virtualisation hosts, firewalls, databases, certificates and Raspberry Pi devices.

It is organised into the same sections as the original workbook, one page each — reach any of them from the AI/SI Prompts menu above. Every task on this page shows three things:

The point of the AI-prompt column is to show how a pile of accumulated tribal knowledge can be turned into something an assistant can reproduce and improve on demand: you keep the intent, and let the model rewrite the mechanics for whatever host you are on today. Nothing on this page should be run without reading it first — several snippets are destructive (dd, rm -rf, postsuper -d ALL, firewall reloads).

Move a WordPress site to a new domain

Rewrites a WordPress site's URL directly in the database — home/siteurl, post GUIDs and inlined links in post content.

Commands
UPDATE wp_options SET option_value = replace(option_value, 'http://www.<OLD_DOMAIN>', 'http://<NEW_DOMAIN>') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.<OLD_DOMAIN>','http://<NEW_DOMAIN>');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.<OLD_DOMAIN>', 'http://<NEW_DOMAIN>');
AI prompt

Generate the SQL statements for the task “Move a WordPress site to a new domain”. Take the old and new base URLs and the table prefix; emit the three UPDATE statements against wp_options and wp_posts, and warn that GUIDs should normally stay frozen. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real credential — read secrets from the environment.

MySQL account & privilege management

Creates a MySQL account for a given host pattern and grants it privileges (and shows how to drop it or reset its password).

Commands
root  Remote Host:  <INTERNAL_IP>  Password:  <DB_PASSWORD>
GRANT ALL PRIVILEGES ON *.* TO root@<INTERNAL_IP> identified by '<DB_PASSWORD>' WITH GRANT OPTION
AI prompt

Generate the SQL statements for the task “MySQL account & privilege management”. Take username, host pattern (e.g. %, 192.168.%, host.domain) and database scope; emit CREATE USER … IDENTIFIED BY, the matching GRANT, and FLUSH PRIVILEGES. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real credential — read secrets from the environment.

Error starting MySQL

Edits the MySQL server config (my.cnf) — bind address or InnoDB buffer size — to fix a startup or locking error.

Commands
Edit /etc/mysql/my.conf  Change bind-address to servers address
AI prompt

Generate the config snippet for the task “Error starting MySQL”. Show the [mysqld] keys to set (bind-address, innodb_buffer_pool_size), where the file lives on Debian vs RHEL, and the restart command. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real credential — read secrets from the environment.