From 857d7a620d56afcbaa776ec4276327163d155b8c Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Tue, 24 Jul 2018 00:22:02 -0700 Subject: [PATCH] Revert "Merge pull request #69 from bcho/fix/mysql-url-password-encode" This reverts commit 78d696c1e50611ce975c04781ea07319acaa976a, reversing changes made to 18583d5a91ec6da5256690faaadef3e850f9d61f. --- database/mysql/mysql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/mysql/mysql.go b/database/mysql/mysql.go index ea4d2ad..428fcb8 100644 --- a/database/mysql/mysql.go +++ b/database/mysql/mysql.go @@ -90,7 +90,6 @@ func WithInstance(instance *sql.DB, config *Config) (database.Driver, error) { } func (m *Mysql) Open(url string) (database.Driver, error) { - url = strings.TrimPrefix(url, "mysql://") purl, err := nurl.Parse(url) if err != nil { return nil, err @@ -100,7 +99,8 @@ func (m *Mysql) Open(url string) (database.Driver, error) { q.Set("multiStatements", "true") purl.RawQuery = q.Encode() - db, err := sql.Open("mysql", migrate.FilterCustomQuery(purl).String()) + db, err := sql.Open("mysql", strings.Replace( + migrate.FilterCustomQuery(purl).String(), "mysql://", "", 1)) if err != nil { return nil, err }