输出表名:
clickhouse-client --host 192.168.1.136 --port=9000 --password 123456 --multiquery --query="use db_pushmsg;show tables;"> /tmp/db_pushmsg.txt
输出表结构
#!/bin/bash echo 'use db_pushmsg;' >> /tmp/db_pushmsg_tableDDL.sql cat /tmp/db_pushmsg.txt |while read eachline do clickhouse-client --host 192.168.1.136 --port=9000 --password 123456 --multiquery --query="use db_pushmsg;show create table $eachli ne;">> /tmp/db_pushmsg_tableDDL.sql echo ';' >> /tmp/db_pushmsg_tableDDL.sql done sed -i -e 's/\\n/ /g; s/\\//g; s/\\'\|'\|'\''//g' /tmp/db_pushmsg_tableDDL.sql
标签:tmp,--,db,pushmsg,如何,sql,tableDDL,clickhouse,结构 From: https://www.cnblogs.com/hxlasky/p/18150109