Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法正确连接 db #226

Open
liubq919 opened this issue Dec 4, 2023 · 0 comments
Open

无法正确连接 db #226

liubq919 opened this issue Dec 4, 2023 · 0 comments

Comments

@liubq919
Copy link

liubq919 commented Dec 4, 2023

官网的代码,
https://docs.taosdata.com/connector/go/

package main

import (
    "database/sql"
    "fmt"

    _ "github.com/taosdata/driver-go/v3/taosSql"
)

func main() {
    var taosUri = "root:taosdata@tcp(localhost:6030)/"
    taos, err := sql.Open("taosSql", taosUri)
    if err != nil {
        fmt.Println("failed to connect TDengine, err:", err)
        return
    }
}

在测试中,taosUri被随便乱改成错误的地址,如 root:taosdata@tcp(localhost:60301)/, sql.Open("taosSql", taosUri)的返回的 err 一直是 nil 。
本地环境如下:

  • TDengine-server-3.2.1.0-Linux-x64.deb
  • github.com/taosdata/driver-go/v3 v3.5.1
  • golang 1.21.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant