账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    go连接ClickHouse, 响应 driver: bad connection,通过客户端能连上,不知是否与驱动版本有关
    61
    0
    采用官方最简单的例子,始终不行, 希望有经验的大佬帮忙看下,感谢go.modmodule ck-testgo 1.16require ( github.com/ClickHouse/clickhouse-go v1.4.1 github.com/jmoiron/sqlx v1.2.1-0.20200614204820-f5f08a7e27f6)main.gopackage mainimport ( _ "github.com/ClickHouse/clickhouse-go" "github.com/jmoiron/sqlx")func main() { connect, err := sqlx.Open("clickhouse", "tcp://127.0.0.1:9000?debug=true&read_timeout=10&write_timeout=10") if err != nil { panic(err) } var items []interface{} sql := "select * from statics.mysql_slow_log"; if err := connect.Select(&items, sql); err != nil { panic(err) }}异常:[clickhouse]host(s)=127.0.0.1:9000, database=default, username=default[clickhouse][dial] secure=false, skip_verify=false, strategy=random, ident=1, server=0 -> 127.0.0.1:9000[clickhouse][connect=1][hello] -> Golang SQLDriver 1.1.54213[clickhouse][connect=1][connect] read error: read tcp 127.0.0.1:49634->127.0.0.1:9000: i/o timeout[clickhouse]host(s)=127.0.0.1:9000, database=default, username=default[clickhouse][dial] secure=false, skip_verify=false, strategy=random, ident=2, server=0 -> 127.0.0.1:9000[clickhouse][connect=2][hello] -> Golang SQLDriver 1.1.54213[clickhouse][connect=2][connect] read error: read tcp 127.0.0.1:49638->127.0.0.1:9000: i/o timeout[clickhouse]host(s)=127.0.0.1:9000, database=default, username=default[clickhouse][dial] secure=false, skip_verify=false, strategy=random, ident=3, server=0 -> 127.0.0.1:9000[clickhouse][connect=3][hello] -> Golang SQLDriver 1.1.54213[clickhouse][connect=3][connect] read error: read tcp 127.0.0.1:49641->127.0.0.1:9000: i/o timeoutpanic: driver: bad connection
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 妖王大叔 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部