python连接clickhouse
时间: 2023-06-05 15:47:47 浏览: 287
kettle连接clickhouse所需要全部jar包以及操作手册.rar
5星 · 资源好评率100%
您可以使用Clickhouse-driver库在Python中连接Clickhouse。
安装方法:
```
pip install clickhouse-driver
```
连接代码示例:
```python
import clickhouse_driver
conn = clickhouse_driver.connect(
host='host_name',
port=9000,
user='user_name',
password='password',
database='database_name'
)
cursor = conn.cursor()
cursor.execute("SELECT * from table_name")
print(cursor.fetchall())
```
更多详细信息,请参考Clickhouse-driver官方文档:https://github.com/mymarilyn/clickhouse-driver
阅读全文