Skip to content

Commit

Permalink
Revert "Merge pull request #69 from bcho/fix/mysql-url-password-encode"
Browse files Browse the repository at this point in the history
This reverts commit 78d696c, reversing
changes made to 18583d5.
  • Loading branch information
dhui committed Jul 25, 2018
1 parent fad64ed commit 857d7a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 857d7a6

Please sign in to comment.