Syntax
Arguments
| Argument | Description |
|---|---|
datasource | Name of the section with connection settings in the odbc.ini file. |
external_database | Name of a database in an external DBMS. |
external_table | Name of a table in the external_database. |
clickhouse-odbc-bridge. If the ODBC driver is loaded directly from clickhouse-server, driver problems can crash the ClickHouse server. ClickHouse automatically starts clickhouse-odbc-bridge when it is required. The ODBC bridge program is installed from the same package as the clickhouse-server.
The fields with the NULL values from the external table are converted into the default values for the base data type. For example, if a remote MySQL table field has the INT NULL type it is converted to 0 (the default value for ClickHouse Int32 data type).
Usage Example
Getting data from the local MySQL installation via ODBC This example is checked for Ubuntu Linux 18.04 and MySQL server 5.7. Ensure that unixODBC and MySQL Connector are installed. By default (if installed from packages), ClickHouse starts as userclickhouse. Thus you need to create and configure this user in the MySQL server.
/etc/odbc.ini.
isql utility from the unixODBC installation.