// OpenDB opens a mysql connection FD
OpenDB opens a mysql connection FD
// OpenDB opens a mysql connection FD
func OpenDB(cfg DBConfig) (*sql.DB, error) {
	dbDSN := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4", cfg.User, cfg.Password, cfg.Host, cfg.Port, cfg.Schema)
	dbConn, err := sql.Open("mysql", dbDSN)
	if err != nil {
		return nil, errors.Trace(err)
	}
	err = dbConn.Ping()
	return dbConn, errors.Trace(err)
}
func OpenDB ( cfg DBConfig ) ( * sql . DB , error ) { dbDSN := fmt . Sprintf ( " " , cfg . User , cfg . Password , cfg . Host , cfg . Port , cfg . Schema ) dbConn , err := sql . Open ( " " , dbDSN ) if err != nil { return nil , errors . Trace ( err ) } err = dbConn . Ping ( ) return dbConn , errors . Trace ( err ) }
OpenDB opens a mysql connection FD
OpenDB opens a mysql connection FD