MySQL client
high risk
mysql --safe-updates …Block unscoped updates/deletesmysqldump --single-transaction <db> > backup.sqlBack up firstClient for MySQL/MariaDB. See the flags and examples below, and run `man mysql` for the full reference.
| Flag | Meaning |
|---|---|
-u | User |
-h | Host |
-p | Prompt for password (avoid -pPASSWORD) |
-e | Execute a statement |
--safe-updates --safe-updates | Refuse UPDATE/DELETE without WHERE or LIMIT |
mysql --safe-updates -u app -p -h dbInteractive with guard rails · explain & risk-check →mysql -e "SHOW PROCESSLIST"Running queries · explain & risk-check →Reference text is hand-written and may be incomplete — check man mysql for your version. Test destructive commands on a non-production system first.