Revert "Merge pull request #69 from bcho/fix/mysql-url-password-encode"

This reverts commit 78d696c1e5, reversing
changes made to 18583d5a91.
This commit is contained in:
Dale Hui 2018-07-24 00:22:02 -07:00
parent fad64ed381
commit 857d7a620d
1 changed files with 2 additions and 2 deletions

View File

@ -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
}