open-falcon/mymon

NewMySQLConnection Error: Building mysql connection failed!: authentication error

akin520 opened this issue · 1 comments

配置都对,20多台,就两台出现这种 情况

使用IP怎么也连不上,具体不知道是什么原来,后来用unix连接,没问题
package main

import (
"fmt"

    "github.com/ziutek/mymysql/mysql"
    _ "github.com/ziutek/mymysql/native"
    //_ "github.com/ziutek/mymysql/thrsafe"

)

func main() {
user := "root"
pass := "root"
dbname := "test"
//proto := "unix"
addr := "/tmp/mysql.sock"
proto := "unix"
//addr := "127.0.0.1:3306"

    db := mysql.New(proto, "", addr, user, pass, dbname)

    fmt.Printf("Connect to %s:%s... ", proto, addr)
    err := db.Connect()
    fmt.Println(err != nil)

}
配置文件,改成unix连接就OK