package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
func main() {
db, err := gorm.Open("mysql", "root:password@tcp(129.226.160.114:3306)/basic?charset=utf8")
if err != nil {
fmt.Println("数据库连接错误")
}
fmt.Println(err)
defer db.Close()
}