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
Release: 2016-05-31 08:47:03
Original
1009 people have browsed it

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)

}

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template