diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index 2b6282da3..f4b86a38f 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -576,13 +576,15 @@ var AddDatabases = &gormigrate.Migration{ _ = tx.Where("name = ?", mysqlInfo.Name).First(&mysqlDb).Error if mysqlDb.ID == 0 { if err := tx.Create(&model.Database{ - Name: mysqlDb.Name, - Type: "mysql", - Version: mysqlInfo.Version, - From: "local", - Address: mysqlInfo.ServiceName, - Username: "root", - Password: mysqlInfo.Password, + AppInstallID: mysqlInfo.ID, + Name: mysqlInfo.Name, + Type: "mysql", + Version: mysqlInfo.Version, + From: "local", + Address: mysqlInfo.ServiceName, + Port: uint(mysqlInfo.Port), + Username: "root", + Password: mysqlInfo.Password, }).Error; err != nil { return err } diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 6dcfe722c..3c09b456b 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -164,7 +164,7 @@ -
+