### mysql引擎
create table t_mysql( id Int32, name String,) engine = MySQL('127.0.0.1:3306', 'test', 't', 'root', '123456');
mysql进行ddl:
alter table t modify name int ,add age tinyint;
mysql增加、批改mysql字段时,ch无奈失效,须要重建,群里有人说重启能够,我测试重启没有失效
### mysql同步到ch限度
CREATE DATABASE t_mysql ENGINE = MaterializeMySQL('127.0.0.1:3306', 'db', 'root', '123456');库创立后,ch先全量,再做为mysql的从库实时时同步mysql数据,但有一些限度:
- mysql5.6及以下版不反对
- ch版本太低也不反对,至多20.9以上
mysql参数(binlog为row,开启gtid)
binlog_format = row gtid-mode = on enforce-gtid-consistency =1 log-slave-updates = true # mysql从库 default_authentication_plugin='mysql_native_password' # 8.0默认caching_sha2_password
- 库中如果有无主键的表,会初始化失败
不反对like (creat table t1 like t;)
Code: 48. DB::Exception: Received from 192.x.x.x:9000. DB::Exception: Cannot convert create like statement to ClickHouse SQL: While executing MYSQL_QUERY_EVENT. The query: create table t_1 like t