ClickHouse / ClickHouse/ClickHouse
Connection to ClickHouse via port 9004 (MySQL protocol) from PowerBI is not working
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
> You have to provide the following information whenever possible.
**Describe what's wrong**
cannot connect to ClickHouse from PowerBI via MySQL port 9004
different syntax errors
> A clear and concise description of what works not as it is supposed to.
ClickHouse version 24.3.2.23 (official build)
PowerBI Desktop: 2.127.1327.0 64-bit (March 2024)
cannot setup connection from PowerBI to ClickHouse via port 9004 (MySQL protocol)
**How to reproduce**
**Scenario 1:**
- PowerBI - New Report, Get Data - MySQL server
- Connection Details:
Server: mytestch.uk.cloudapp.azure.com:9004
Database: dev
Include Relationship Columns: FALSE/TRUE
Navigate Using full Hierarchy: FALSE
Command timeout: empty
SQL statement: empty
Connection type: Database Username: test; Password: %%%%%
- ERROR:
_"MySQL: Code: 47. DB::Exception: Unknown expression identifier 'CREATE_TIME' in scope SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, CREATE_TIME AS CREATED_DATE, UPDATE_TIME AS MODIFIED_DATE, TABLE_COMMENT AS DESCRIPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dev'. Maybe you meant: ['CREATED_DATE']. (UNKNOWN_IDENTIFIER) (version 24.3.2.23 (official build))"_
**Scenario 2:**
- PowerBI - New Report, Get Data - MySQL server
- Connection Details:
Server: mytestch.uk.cloudapp.azure.com:9004
Database: dev
Include Relationship Columns: FALSE/TRUE
Navigate Using full Hierarchy: TRUE
Command timeout: empty
SQL statement: empty
Connection type: Database Username: test; Password: %%%%%
- ERROR:
_"Details: "An error happened while reading data from the provider: 'Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.'"_
**Scenario 3:**
- PowerBI - New Report, Get Data - MySQL server
- Connection Details:
Server: mytestch.uk.cloudapp.azure.com:9004
Database: dev
Include Relationship Columns: FALSE
Navigate Using full Hierarchy: FALSE
Command timeout: empty
SQL statement: select * from mysql_test
Connection type: Database Username: test; Password: %%%%%
- ERROR:
_Details: "MySQL: Code: 62. DB::Exception: Syntax error: failed at position 6 ('COLLATION'): COLLATION. Expected one of: CREATE, FULL, DATABASES, CLUSTERS, MERGES, FILESYSTEM CACHES, CLUSTER, CHANGED, SETTINGS, TABLES, DICTIONARIES, EXTENDED, COLUMNS, FIELDS, ENGINES, FUNCTIONS, INDEX, INDEXES, INDICES, KEYS, SETTING, CREATE, DATABASE, DICTIONARY, VIEW, TABLE, PROCESSLIST, ACCESS, USERS, ROLES, SETTINGS PROFILES, PROFILES, ROW POLICIES, POLICIES, QUOTAS, CURRENT ROLES, ENABLED ROLES, CURRENT QUOTA, QUOTA, GRANTS, PRIVILEGES."_
* Which ClickHouse server version to use: 24.3.2.23 (official build)
* Which interface to use, if it matters: MySQL, Port 9004
* `CREATE TABLE` statements for all tables involved
`create table mysql_test (id UInt32 not null, code Nullable(String)) Engine = MergeTree() order by (id);`
* Sample data for all these tables, use [clickhouse-obfuscator]
```
insert into mysql_test values (1,'1');
insert into mysql_test values (2,'2');
insert into mysql_test values (3,'3');
```
* Error Stack:
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000cbcedbb
1. DB::Exception::Exception(int, FormatStringHelperImpl::type>, String&&) @ 0x000000000765c563
2. DB::DataTypeNullable::DataTypeNullable(std::shared_ptr const&) @ 0x00000000100a1528
3. std::shared_ptr std::allocate_shared[abi:v15000], std::shared_ptr const&, void>(std::allocator const&, std::sh
ared_ptr const&) @ 0x000000000e5a6872
4. DB::InterpreterCreateQuery::getColumnsDescription(DB::ASTExpressionList const&, std::shared_ptr, bool, bool) @ 0x0000000010b6573f
5. DB::InterpreterCreateQuery::getTablePropertiesAndNormalizeCreateQuery(DB::ASTCreateQuery&) const @ 0x0000000010b69302
6. DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x0000000010b71834
7. DB::InterpreterCreateQuery::execute() @ 0x0000000010b842cf
8. DB::SystemLog::prepareTable() @ 0x0000000011041b2b
9. DB::SystemLog::savingThreadFunction() @ 0x00000000110437cb
10. void std::__function::__policy_invoker::__call_impl::ThreadFromGlobalPoolImpl::startup()::'lambda'()>(DB::SystemLog
Base::startup()::'lambda'()&&)::'lambda'(), void ()>>(std::__function::__policy_storage const*) @ 0x000000000ccc37b4
11. void* std::__thread_proxy[abi:v15000]>, void ThreadPoolImpl::scheduleImpl(std::function, Priority, std::optional, bool)::'lambda0'()>>(void*) @ 0x000000000cc7d9ed
12. ? @ 0x00007b9e76694ac3
13. ? @ 0x00007b9e76726850
(version 24.3.2.23 (official build))
2024.04.05 12:57:53.346650 [ 6687 ] {} MySQLHandler: DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 3
2024.04.05 12:57:53.419285 [ 6687 ] {} MySQLHandler: DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 3
2024.04.05 12:57:57.105449 [ 4758 ] {} void DB::SystemLog::flushImpl(const std::vector &, uint64_t) [LogElement = DB::MetricLogElement]: Code: 43. DB::Exception: Nested type LowCardinality(String
) cannot be inside Nullable type. (ILLEGAL_TYPE_OF_ARGUMENT), Stack trace (when copying this message, always include the lines below):
2024.04.05 12:59:52.980016 [ 6766 ] {} MySQLHandler: MySQLHandler: Cannot read packet: : Code: 62. DB::Exception: Syntax error: failed at position 6 ('COLLATION'): COLLATION. Expected one of: CREATE, FULL, DATABASES, CLUSTERS, ME
RGES, FILESYSTEM CACHES, CLUSTER, CHANGED, SETTINGS, TABLES, DICTIONARIES, EXTENDED, COLUMNS, FIELDS, ENGINES, FUNCTIONS, INDEX, INDEXES, INDICES, KEYS, SETTING, CREATE, DATABASE, DICTIONARY, VIEW, TABLE, PROCESSLIST, ACCESS, USERS, ROLE
S, SETTINGS PROFILES, PROFILES, ROW POLICIES, POLICIES, QUOTAS, CURRENT ROLES, ENABLED ROLES, CURRENT QUOTA, QUOTA, GRANTS, PRIVILEGES. (SYNTAX_ERROR), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000cbcedbb
1. DB::Exception::createDeprecated(String const&, int, bool) @ 0x000000000cc2b04d
2. DB::parseQueryAndMovePosition(DB::IParser&, char const*&, char const*, String const&, bool, unsigned long, unsigned long, unsigned long) @ 0x0000000012c0d90a
3. DB::executeQueryImpl(char const*, char const*, std::shared_ptr, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x000000001126cdce
4. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr, std::function, DB::QueryFlags, std::optional const&, std::function) @ 0x000000001127587e
5. DB::MySQLHandler::comQuery(DB::ReadBuffer&, bool) @ 0x000000001232a4c2
6. DB::MySQLHandler::run() @ 0x0000000012324188
7. Poco::Net::TCPServerConnection::start() @ 0x0000000014c9bef2
8. Poco::Net::TCPServerDispatcher::run() @ 0x0000000014c9cd39
9. Poco::PooledThread::run() @ 0x0000000014d954a1
10. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000014d93a3d
11. ? @ 0x00007b9e76694ac3
12. ? @ 0x00007b9e76726850
(version 24.3.2.23 (official build))
2024.04.05 12:59:57.180302 [ 4758 ] {} void DB::SystemLog::flushImpl(const std::vector &, uint64_t) [LogElement = DB::MetricLogElement]: Code: 43. DB::Exception: Nested type LowCardinality(String
) cannot be inside Nullable type. (ILLEGAL_TYPE_OF_ARGUMENT), Stack trace (when copying this message, always include the lines below):
Contributor guide
Assessment
This issue has not been assessed yet.