问题描述
最近在使用 "github.com/ClickHouse/clickhouse-go" 这个库操作ClickHouse,为了验证程序本地通过docker启了一个ClickHouse,并将端口8123映射出来。
![]()
参考clickhouse-go的github上example编写程序,运行时一直报错:
[clickhouse][dial] secure=false, skip_verify=false, strategy=random, ident=1, server=0 -> [::1]:8123
[clickhouse][connect=1][hello] -> Golang SQLDriver 1.1.54213
[clickhouse][connect=1][connect] read error: read tcp [::1]:49513->[::1]:8123: i/o timeout
runtime error: invalid memory address or nil pointer dereference

原因
程序中ClickHouse端口访问错误。
……
fmt.Println("Clickhouse初始化...")
connect, err := sql.Open(

最低0.47元/天 解锁文章

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



