Skip to main content
Skip to main content

MySQLDump

InputOutputAlias

Description

ClickHouse supports reading MySQL dumps.

It reads all the data from INSERT queries belonging to a single table in the dump. If there is more than one table, by default it reads data from the first one.

Note

This format supports schema inference: if the dump contains a CREATE query for the specified table, the structure is inferred from it, otherwise the schema is inferred from the data of INSERT queries.

Example Usage

Given the following SQL dump file:

We can run the following queries:

Format Settings

You can specify the name of the table from which to read data from using the input_format_mysql_dump_table_name setting. If setting input_format_mysql_dump_map_columns is set to 1 and the dump contains a CREATE query for specified table or column names in the INSERT query, the columns from the input data will map to the columns from the table by name. Columns with unknown names will be skipped if setting input_format_skip_unknown_fields is set to 1.