Skip to content
This repository was archived by the owner on Jun 28, 2018. It is now read-only.
This repository was archived by the owner on Jun 28, 2018. It is now read-only.

MySQL driver can't handle non-alphanumeric passwords #256

@wrrn

Description

@wrrn

Problem

When using non-alphanumeric credentials, migrate fails to connect. database/mysql/mysql.go#L93 calls migrate.FilterCustomQuery(purl).String() which in turn calls url.UserInfo.String(). url.UserInfo.String() ends up escaping the password resulting in an access denied error.

Input

The password in question is password&[.

I run the migrate tool using.

migrate -path migrations -database 'mysql://test:password&[@tcp(localhost:3306)/test' up

Output

error: Error 1045: Access denied for user 'test'@'localhost' (using password: YES)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions