FLUSH, KILL and CLONE

Server Commands: FLUSH, RESET, KILL, and CLONE

FLUSH reopens server resources: FLUSH BINARY LOGS starts a new binary log (here binlog.000003), FLUSH ERROR LOGS reopens a file after logrotate 1,548 (Log Rotation), and FLUSH TABLES WITH READ LOCK is the global read lock (Table and Metadata Locks).

RESET discards state. MySQL 8.4 524 removed the master/slave spellings, which fail with ERROR 1064 on 9.7.2: RESET MASTER is now RESET BINARY LOGS AND GTIDS (it deletes every binary log and empties gtid_executed), SHOW MASTER STATUS is SHOW BINARY LOG STATUS, SHOW SLAVE STATUS is SHOW REPLICA STATUS, and CHANGE MASTER TO is CHANGE REPLICATION SOURCE TO.

KILL ends a connection, or with QUERY just its statement; locking an account (Locking and Dropping) leaves its sessions running until you kill them. While a first session ran SELECT SLEEP(60):

Stopping a runaway statement from a second sessionSQL
SELECT id, user, command, time, state, info FROM performance_schema.processlist
WHERE info LIKE 'SELECT SLEEP%';
KILL QUERY 20;
Output
+----+------+---------+------+------------+------------------+
| id | user | command | time | state      | info             |
+----+------+---------+------+------------+------------------+
| 20 | root | Query   |    2 | User sleep | SELECT SLEEP(60) |
+----+------+---------+------+------------+------------------+

The sleeper returned 1 at once, SLEEP()'s way of reporting an interruption.

CLONE copies a running InnoDB instance as physical files. INSTALL PLUGIN clone SONAME 'mysql_clone.so' and then CLONE LOCAL DATA DIRECTORY = '/var/lib/mysql-files/clone-2026-09-23' wrote an 80 MB directory holding ibdata1, mysql.ibd, the undo and redo files and a shop folder: a complete data directory to start a mysqld on. CLONE INSTANCE FROM 'user'@'source':3306 IDENTIFIED BY '...' pulls the same snapshot over the network into a new replica.