Skip to content

Enhanced MySQL compatibility #9336

@meob

Description

@meob

Use case
The basic idea is to increase the MySQL compatibility with wire protocol in order to have tools like phpMyAdmin, DBeaver, ... working easily on ClickHouse (reading data)

Describe the solution you'd like
ClickHouse MySQL wire protocol works fine with application (eg. PHP, Perl, ...) but has problems with MySQL tools since they use "custom" SQL commands that MySQL understand while ClickHouse gives problems.
We propose to add a flag that enhance MySQL compatibility.
The solution requires two approach:

  1. Support more MySQL command
    There are commands like "SET NAMES utf8", "SET autocommit=1", ... that have no meaning
    and can simply do nothing in CH but reply OK if the flag is active
  2. Create the "mysql" data dictionary database
    This can be easly created in ClickHouse using VIEWs from SYSTEM

The goal is to reach a "read only" compatibility with MySQL.
Creating CH data structures or traslating DML language requires much more work
and is not needed.

Describe alternatives you've considered
I used a simple self-made proxy to skip MySQL custom command... and it works!

Additional context
This compatibility could enable CH+wire protocol to be used as a MySQL DB with Linked Server in SQLServer, FDW in PostgreSQL, Oracle gateway, ...

I can provide the list of commands, variables, data dictionary views I have found till now...

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-foreign-dbConnectivity to external databases (ODBC/JDBC, MySQL, PostgreSQL, etc.).comp-mysqlMySQL-specific integration (table engine/function/protocol mapping).feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions