MySQL Database Engine
Not supported in ClickHouse Cloud
Allows to connect to databases on a remote MySQL server and perform 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
Engine Parameters
host:port— MySQL server address.database— Remote database name.user— MySQL user.password— User password.
Data Types Support
| MySQL | ClickHouse |
|---|---|
| UNSIGNED TINYINT | UInt8 |
| TINYINT | Int8 |
| UNSIGNED SMALLINT | UInt16 |
| SMALLINT | Int16 |
| UNSIGNED INT, UNSIGNED MEDIUMINT | UInt32 |
| INT, MEDIUMINT | Int32 |
| UNSIGNED BIGINT | UInt64 |
| BIGINT | Int64 |
| FLOAT | Float32 |
| DOUBLE | Float64 |
| DATE | Date |
| DATETIME, TIMESTAMP | DateTime |
| BINARY | FixedString |
All other MySQL data types are converted into String.
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
note
By now these variables are stubs and don't correspond to anything.
Example:
Examples of Use
Table in MySQL:
Database in ClickHouse, exchanging data with the MySQL server: