一、安装:
按照官方文档推荐,用yum方式安装最方便
#yum install yum-utils -y
# rpm --import https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG
# yum-config-manager --add-repo https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
Loaded plugins: fastestmirror
adding repo from: https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
[repo.yandex.ru_clickhouse_rpm_stable_x86_64]
name=added from: https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
baseurl=https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
enabled=1
# yum install clickhouse-server clickhouse-client -y (此步时间有点长,多等会)

二、使用
启动client

退出client

显示已有数据库

创建数据库

创建表
例如: CREATE TABLE colleague (Date Date,Name char,Age UInt16,Year UInt16) ENGINE = MergeTree(Date, (Year,Date), 8192);

给表插入一些测试数据
例如:insert into colleague (Date,Name,Age,Year)values('2020-07-16','james','28','2020');

本文详细介绍了如何通过yum方式在Linux环境下快速安装ClickHouse数据库,并提供了从启动客户端到创建数据库、表及插入测试数据的完整流程。适用于希望快速上手ClickHouse的初学者。
500

被折叠的 条评论
为什么被折叠?



