From a36f13b81753a28837bc6bf4fbecbf8afa52ec1f Mon Sep 17 00:00:00 2001 From: Helzoph <50453568+Helzoph@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:41:40 +0800 Subject: [PATCH] fix: Modify mysql port --- db/db.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/db.go b/db/db.go index f4d87d4..73b62cc 100644 --- a/db/db.go +++ b/db/db.go @@ -25,14 +25,12 @@ import ( _ "github.com/go-sql-driver/mysql" ) -var ( - handle *sql.DB -) +var handle *sql.DB func Init(username, password, protocol, address, database string) error { var err error - handle, err = sql.Open("mysql", username+":"+password+"@"+protocol+"("+address+":13306)/"+database) + handle, err = sql.Open("mysql", username+":"+password+"@"+protocol+"("+address+":3306)/"+database) if err != nil { return fmt.Errorf("failed to open database connection: %s", err) }