func SetConfig(filename string) (*Model, error) {
	c := new(Model)
	conf := goini.SetConfig(filename)
	charset := conf.GetValue("database", "charset")
	username := conf.GetValue("database", "username")
	password := conf.GetValue("database", "password")
	hostname := conf.GetValue("database", "hostname")
	database := conf.GetValue("database", "database")
	port := conf.GetValue("database", "port")
	db, err := sql.Open("mysql", username+":"+password+"@tcp("+hostname+":"+port+")/"+database+"?charset="+charset)
	err = db.Ping()
	if err != nil {
		return c, err
	}
	c.db = db
	return c, err
}
use goini read the configuration file and connect the mysql database
package gomysql
import (
	"database/sql"
	"errors"
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"github.com/widuu/goini"
	"regexp"
	"strconv"
	"strings"
)
type Model struct {
	db        *sql.DB
	tablename string
	param     []string
	columnstr string
	where     string
	pk        string
	orderby   string
	limit     string
	join      string
}