Skip to content

Commit 3022c91

Browse files
committed
fix: mysql包含特殊字符连接失败
1 parent 185f0fd commit 3022c91

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

pkg/db/mysql.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package db
33
import (
44
"database/sql"
55
"fmt"
6-
"net/url"
76
"regexp"
87
"slices"
98

@@ -20,8 +19,6 @@ type MySQL struct {
2019
}
2120

2221
func NewMySQL(username, password, address string, typ ...string) (*MySQL, error) {
23-
username = url.QueryEscape(username)
24-
password = url.QueryEscape(password)
2522
dsn := fmt.Sprintf("%s:%s@tcp(%s)/", username, password, address)
2623
if len(typ) > 0 && typ[0] == "unix" {
2724
dsn = fmt.Sprintf("%s:%s@unix(%s)/", username, password, address)

0 commit comments

Comments
 (0)