SQL reference (MySQL and MariaDB dialects)

FLUSH, LOCK TABLES, KILL and LOAD DATA

Statements that are accepted and do nothing (FLUSH, LOCK TABLES), and statements that are refused (KILL, LOAD DATA).

Syntax#

SQL
FLUSH flush_option [, flush_option] ...      -- everything up to the end of the statement is read
LOCK TABLES ... | LOCK INSTANCE FOR BACKUP
UNLOCK TABLES | UNLOCK INSTANCE
KILL [CONNECTION | QUERY] processlist_id
LOAD DATA [LOCAL] INFILE 'file' INTO TABLE tbl_name ...

Remarks#

  • FLUSH: accepted for any option (PRIVILEGES, TABLES, LOGS, STATUS, ...). It needs the RELOAD privilege (error 1227 without). There is nothing to flush; every account change is seen at once. Answer: OK.
  • LOCK TABLES, UNLOCK TABLES, LOCK INSTANCE FOR BACKUP, UNLOCK INSTANCE: the whole statement is read and ignored; they lock nothing (see transactions). LOCK and UNLOCK commit an open transaction (implicit commit).
  • KILL: not supported, error 1235 ("this statement").
  • LOAD DATA, LOAD XML, LOAD INDEX: not supported, error 1235. To load data use INSERT (multi-row VALUES is fast), INSERT ... SELECT, or a mysqldump file: the stock mysqldump exports from and loads into Raft DB with its default options (D64; a 15 MB dump of 130 tables and 74,878 rows loads in 49 s on Raft DB).
  • The client programs' own commands (DELIMITER, SOURCE, \G) belong to the client and never reach the server.

Examples#

SQL
FLUSH PRIVILEGES;
LOCK TABLES t WRITE;
UNLOCK TABLES;

See also#