create DATABASE mysql_app_db ENGINE = MySQL('172.17.0.1:13306', 'dbname', 'user', 'password');
CREATE DATABASE mysql_app_db
ENGINE = MySQL('172.17.0.1:13306', 'dbname', 'user', 'password')Received exception from server (version 19.8.3):
Code: 336. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Unknown database engine:
ENGINE = MySQL('172.17.0.1:13306', 'dbname', 'user', 'password').0 rows in set. Elapsed: 0.133 sec.
需要使用Clickhouse读取Mysql数据库数据,在Clickhouse中建立mysql引擎的数据mysql_db_app指向需要读取的MySQL数据库。不想却报了错:
Unknown databse engine ——用俺河南话说就是这货还不知道mysql引擎是弄啥嘞啊。从错误信息中注意到当前使用的Clickhouse版本是19.x,可能是当前版本还没有添加MySQL引擎数据库功能,抱着试一试的态度准备升级个20.x,毕竟使用docker安装这些软件那是得劲类很:
--重tag现有镜像
tianlang@tianlang-VirtualBox:~$ docker images |grep clickhouse
yandex/clickhouse-server latest 8e4e71f24366 19 months ago 484MB
yandex/clickhouse-client latest 4d1c9c06f912 19 months ago 459MB-- -- 把现有镜像重tag
tianlang@tianlang-VirtualBox:~$ docker tag yandex/clickhouse-server:latest yandex/clickhouse-server:19.8.3.8
tianlang@tianlang-VirtualBox:~$ docker tag yandex/clickhouse-client:latest yandex/clickhouse-client:19.8.3.8
tianlang@tianlang-VirtualBox:~$ docker images |grep clickhouse
yandex/clickhouse-server 19.8.3.8 8e4e71f24366 19 months ago 484MB
yandex/clickhouse-server latest 8e4e71f24366 19 months ago 484MB
yandex/clickhouse-client 19.8.3.8 4d1c9c06f912 19 months ago 459MB
yandex/clickhouse-client latest 4d1c9c06f912 19 months ago 459MB-- -- 删除tag为latest的镜像,这样才好重新拉取
tianlang@tianlang-VirtualBox:~$ docker rmi yandex/clickhouse-server:latest
Untagged: yandex/clickhouse-server:latest
tianlang@tianlang-VirtualBox:~$ docker images |grep clickhouse
yandex/clickhouse-server 19.8.3.8 8e4e71f24366 19 months ago 484MB
yandex/clickhouse-client 19.8.3.8 4d1c9c06f912 19 months ago 459MB
yandex/clickhouse-client latest 4d1c9c06f912 19 months ago 459MB
tianlang@tianlang-VirtualBox:~$ docker rmi yandex/clickhouse-client:latest
Untagged: yandex/clickhouse-client:latest-- 重新拉取最新的镜像
tianlang@tianlang-VirtualBox:~$ docker pull yandex/clickhouse-server:latest
latest: Pulling from yandex/clickhouse-server
da7391352a9b: Pull complete
14428a6d4bcd: Pull complete
2c2d948710f2: Pull complete
076cd2c6a81e: Pull complete
201ea6cda8c8: Pull complete
0d7b4e598027: Pull complete
0d86a58e3639: Pull complete
3b78a4fd0f92: Pull complete
86d65487f611: Pull complete
dc82dea7d6fe: Pull complete
Digest: sha256:8f669dafd35eb527210cc77973ed927734dff2c2cafd345823c8c99769124fd1
Status: Downloaded newer image for yandex/clickhouse-server:latest
docker.io/yandex/clickhouse-server:latest
tianlang@tianlang-VirtualBox:~$ docker pull yandex/clickhouse-client:latest
latest: Pulling from yandex/clickhouse-client
f22ccc0b8772: Pull complete
3cf8fb62ba5f: Pull complete
e80c964ece6a: Pull complete
6f064a173914: Pull complete
37a06aaf9ee5: Pull complete
Digest: sha256:504e18bed5162a20bbff6071ca1b7c7baca1380d2e2755e4d6bf4bac7e534531
Status: Downloaded newer image for yandex/clickhouse-client:latest
docker.io/yandex/clickhouse-client:latest
tianlang@tianlang-VirtualBox:~$ docker images |grep clickhouse
yandex/clickhouse-server latest 57e938a0aaae 3 weeks ago 819MB
yandex/clickhouse-client latest e677d3a4035c 3 weeks ago 492MB
yandex/clickhouse-server 19.8.3.8 8e4e71f24366 19 months ago 484MB
yandex/clickhouse-client 19.8.3.8 4d1c9c06f912 19 months ago 459MB
使用拉取好的最新docker镜像启动一个Clickhouses并尝试创建MySQL引擎的数据库.
还真没有再报错了。新版本就是牛!感谢Docker让俺这么快就用上了新版本.
不知道19版本的Clickhouse要使用MySQL引擎是不是需要些额外的操作.