This commit is contained in:
laodaming 2023-06-16 12:28:14 +08:00
parent 186a30d429
commit 56f8e16463

View File

@ -10,7 +10,7 @@ import (
// SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
// 初始化mysql
func InitMysql(sourceMysql string) *gorm.DB {
dsn := sourceMysql + "?" + "charset=utf8mb4&parseTime=true"
dsn := sourceMysql + "?charset=utf8mb4&parseTime=true"
db, err := gorm.Open(mysql.New(mysql.Config{
DSN: dsn, // DSN data source name
DefaultStringSize: 255, // string 类型字段的默认长度