Other Administrative Statements • FLUSH TABLES  tbl_name  [,  tbl_name ] ... FOR EXPORT This  FLUSH TABLES  variant applies to  InnoDB  tables. It ensures that changes to the named tables have been flushed to disk so that binary table copies can be made while the server is running. This operation requires the  FLUSH_TABLES  or  RELOAD  privilege. Because it acquires locks on tables in preparation for exporting them, it also requires the  LOCK TABLES  and  SELECT  privileges for each table. The operation works like this: 1. It acquires shared metadata locks for the named tables. The operation blocks as long as other sessions have active transactions that have modified those tables or hold table locks for them. When the locks have been acquired, the operation blocks transactions that attempt to update the tables, while permitting read-only operations to continue. 2. It checks whether all storage engines for the tables support  FOR EXPORT . If any do not, an ER_ILLEGAL_HA  error occurs and the operation fails. 3. The operation notifies the storage engine for each table to make the table ready for export. The storage engine must ensure that any pending changes are written to disk. 4. The operation puts the session in lock-tables mode so that the metadata locks acquired earlier are not released when the  FOR EXPORT  operation completes. This operation applies only to existing base (non- TEMPORARY ) tables. If a name refers to a base table, that table is used. If it refers to a  TEMPORARY  table, it is ignored. If a name applies to a view, an ER_WRONG_OBJECT  error occurs. Otherwise, an  ER_NO_SUCH_TABLE  error occurs. InnoDB  supports  FOR EXPORT  for tables that have their own  .ibd  file file (that is, tables created with the  innodb_file_per_table  setting enabled).  InnoDB  ensures when notified by the  FOR EXPORT operation that any changes have been flushed to disk. This permits a binary copy of table contents to be made while the  FOR EXPORT  operation is in effect because the  .ibd  file is transaction consistent and can be copied while the server is running.  FOR EXPORT  does not apply to  InnoDB  system tablespace files, or to  InnoDB  tables that have  FULLTEXT  indexes. FLUSH TABLES ...FOR EXPORT  is supported for partitioned  InnoDB  tables. When notified by  FOR EXPORT ,  InnoDB  writes to disk certain kinds of data that is normally held in memory or in separate disk buffers outside the tablespace files. For each table,  InnoDB  also produces a file named  table_name .cfg  in the same database directory as the table. The  .cfg  file contains metadata needed to reimport the tablespace files later, into the same or different server. When the  FOR EXPORT  operation completes,  InnoDB  has flushed all dirty pages to the table data files. Any change buffer entries are merged prior to flushing. At this point, the tables are locked and quiescent: 2976