站内搜索

Looking out for max values in integer

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)

}

  • 上一篇:Testing MySQL FULLTEXT indexes in InnoDB using pt
  • 下一篇:MySQL数据库的自动备份与数据库被破坏后的恢复(3)