INSERT and SELECT queries to exchange data between ClickHouse and MySQL.
The MySQL database engine translate queries to the MySQL server so you can perform operations such as SHOW TABLES or SHOW CREATE TABLE.
You cannot perform the following queries:
RENAMECREATE TABLEALTER
Creating a database
host:port— MySQL server address.database— Remote database name.user— MySQL user.password— User password.
enable_compression
Enables zlib compression for the MySQL protocol connection. When set to 1, ClickHouse requests protocol-level compression from the MySQL server.
Default value: 0.
Example:
TLS/SSL
The credentials of an encrypted connection to MySQL are passed as named collection keys (or as key-value arguments):
The values are the contents of the corresponding PEM files, which can be copied into a named collection or into a query. They are masked in logs and in
SHOW queries, the same way passwords are.
The same credentials can also be given as paths to files on the server, in ssl_ca, ssl_cert and ssl_key — but only in a named collection defined in the server configuration file, and such a value cannot be overridden in a query. The server opens those files with its own privileges, so accepting a path from SQL would let any user who is able to define a MySQL source probe the local filesystem, and authenticate with a certificate and key they are not allowed to read themselves.
Data types support
The conversion of the spatial types (other than
POINT, which is always converted) is controlled by the geometry flag of the mysql_datatypes_support_level setting, enabled by default. The generic GEOMETRY column type is mapped to the umbrella Geometry type (a Variant over the concrete geometric types). Because such a column can hold a value of any subtype, reading a value whose subtype has no ClickHouse counterpart (GEOMETRYCOLLECTION) throws an exception at read time; this incompatibility is accepted in exchange for a proper geometric type. Columns declared with the GEOMETRYCOLLECTION type are converted into String (the raw WKB) like all other MySQL data types.
Nullable is supported.
Global variables support
For better compatibility you may address global variables in MySQL style, as@@identifier.
These variables are supported:
versionmax_allowed_packet
By now these variables are stubs and don’t correspond to anything.