centos7.4安装及使用clickhouse

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、安装:

按照官方文档推荐,用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');

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值