Home >Database >Mysql Tutorial >Looking out for max values in integer-based columns in MySQL_MySQL

Looking out for max values in integer-based columns in MySQL_MySQL

WBOY
WBOYOriginal
2016-05-31 08:47:031006browse

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)

}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn