ClickHouse:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
 
(未显示同一用户的3个中间版本)
第4行: 第4行:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754; echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list; sudo apt update; sudo apt install clickhouse-client clickhouse-server
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754; sudo chmod a+r /usr/share/keyrings/clickhouse-keyring.gpg; echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list; sudo apt update; sudo apt install clickhouse-client clickhouse-server
</syntaxhighlight>
</syntaxhighlight>


第20行: 第20行:
sudo systemctl enable clickhouse-server
sudo systemctl enable clickhouse-server
</syntaxhighlight>
</syntaxhighlight>
== 使用 ==
透過<code>clickhouse-client</code>連上:
<syntaxhighlight lang="bash">
clickhouse-client --password
</syntaxhighlight>
或是[[MySQL]]協定:
<syntaxhighlight lang="bash">
mysql --protocol tcp -u default -p -P 9004
</syntaxhighlight>
或是PostgreSQL協定,但有可能會需要額外設定<ref>{{Cite web |url=https://github.com/ClickHouse/ClickHouse/issues/28159 |title=I can not connect via postgres interface #28159 |language=en |accessdate=2022-07-15}}</ref>:
<syntaxhighlight lang="bash">
psql -p 9005 -h 127.0.0.1 -U default default
</syntaxhighlight>
== 參考文獻 ==
{{Reflist|2}}


== 外部連結 ==
== 外部連結 ==

2023年10月11日 (三) 09:02的最新版本

ClickHouse是一个OLAP数据库。

安装

sudo gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754; sudo chmod a+r /usr/share/keyrings/clickhouse-keyring.gpg; echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list; sudo apt update; sudo apt install clickhouse-client clickhouse-server

启动

预设是不会启动的,需要手动启动:

sudo service clickhouse-server

如果希望开机自动跑起来的话需要设定:

sudo systemctl enable clickhouse-server

使用

透过clickhouse-client连上:

clickhouse-client --password

或是MySQL协定:

mysql --protocol tcp -u default -p -P 9004

或是PostgreSQL协定,但有可能会需要额外设定[1]

psql -p 9005 -h 127.0.0.1 -U default default

参考文献

  1. I can not connect via postgres interface #28159. [2022-07-15] (English). 

外部链接