Pcornel
Databases

MariaDB / MySQL

Cheat sheet · https://pcornel.dk/topic.php?topic=6090

Back to the Topic

Answer

MariaDB and MySQL are open-source relational databases, usually with the InnoDB storage engine, configured in my.cnf and managed with the mysql client and mysqladmin.

Remember

Know which fork and version (features differ). Tune innodb_buffer_pool_size first. Use the slow query log, binary logs for PITR/replication, and least-privilege users.

First checks

  • SHOW GLOBAL VARIABLES LIKE 'innodb_buffer_pool_size'; — buffer pool size
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version

Commands

SHOW GLOBAL STATUS

Verify in this order

client → mysqld → InnoDB (buffer pool, redo, binlog) → disk

Where it usually breaks

Failures commonly involve host-specific grants, authentication plugin differences, exhausted connections, InnoDB recovery/space pressure, binlog/GTID mismatches, replicas that are connected but not applying, and backups that were never restore-tested.

MariaDB / MySQL verification boundary matrix

BoundaryInspectHealthy interpretationDo not infer
IntentServer architectureIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeDatabases/users/privileges / InnoDBOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateConfiguration files and variablesIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeLogsThe original bounded check succeeds in the same time windowProduction correctness outside this scope

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6090

Confirmation

Confirm action

Continue?