当前位置:Gxlcms > mysql > Lookingoutformaxvaluesininteger-basedcolumnsinMySQL_MySQL

Lookingoutformaxvaluesininteger-basedcolumnsinMySQL_MySQL

时间:2021-07-01 10:21:17 帮助过:5人阅读

db,err:=sql.Open("mysql",fmt.Sprintf("%s:%s@tcp(%s:3306)/%s",mysqlUn,mysqlPw,hostToCheck,dbToCheck))

iferr!=nil{

fmt.Printf("Error connecting to MySQL on '%s': n",hostToCheck,err)

db.Close()

os.Exit(1)

}

//Checkconnectionisalive.

err=db.Ping()

iferr!=nil{

fmt.Printf("Unable to ping mysql at '%s': %sn",hostToCheck,err)

db.Close()

os.Exit(1)

}

人气教程排行