nothing
This commit is contained in:
parent
eeeaa2a86f
commit
6b8fabb8d8
@ -141,17 +141,17 @@ func testInsertDeworming() {
|
||||
}
|
||||
|
||||
func insertData() {
|
||||
// testInsertSterilzation()
|
||||
// fmt.Println("testInsertSterilzation success.")
|
||||
testInsertSterilzation()
|
||||
fmt.Println("testInsertSterilzation success.")
|
||||
|
||||
// testInsertBreed()
|
||||
// fmt.Println("testInsertBreed success.")
|
||||
testInsertBreed()
|
||||
fmt.Println("testInsertBreed success.")
|
||||
|
||||
// testInsertStatus()
|
||||
// fmt.Println("testInsertStatus success.")
|
||||
testInsertStatus()
|
||||
fmt.Println("testInsertStatus success.")
|
||||
|
||||
// testInsertAnmGender()
|
||||
// fmt.Println("testInsertAnmGender success.")
|
||||
testInsertAnmGender()
|
||||
fmt.Println("testInsertAnmGender success.")
|
||||
|
||||
testInsertVaccination()
|
||||
fmt.Println("testInsertVaccination success.")
|
||||
@ -163,7 +163,8 @@ func insertData() {
|
||||
func main() {
|
||||
// 1.
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
"root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // ATT MySQL
|
||||
// "root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // ATT MySQL dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
"root", "havocantelope412", "127.0.0.1", "3306", "hav_cats") // ATT MySQL
|
||||
fmt.Println("dsn:", dsn)
|
||||
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
if err != nil {
|
||||
|
@ -5,7 +5,8 @@ Gormv2: # 只针对 gorm 操作数据库有效
|
||||
IsInitGlobalGormMysql: 1 # 随项目启动为gorm db初始化一个全局 variable.GormDbMysql(完全等于*gorm.Db),正确配置数据库,该值必须设置为: 1
|
||||
SlowThreshold: 30 # 慢 SQL 阈值(sql执行时间超过此时间单位(秒),就会触发系统日志记录)
|
||||
Write:
|
||||
Host: "113.44.68.213"
|
||||
# Host: "113.44.68.213"
|
||||
Host: "127.0.0.1"
|
||||
DataBase: "hav_cats"
|
||||
Port: 3306
|
||||
Prefix: "tb_" # 目前没有用到该配置项
|
||||
|
@ -15,7 +15,8 @@ var DB *gorm.DB
|
||||
|
||||
func Init() {
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
"root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // danger MySQL
|
||||
"root", "havocantelope412", "127.0.0.1", "3306", "hav_cats") // ATT MySQL
|
||||
|
||||
fmt.Println("dsn:", dsn)
|
||||
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user