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

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

Open
wrrn opened this issue Jun 22, 2017 · 1 comment · Fixed by golang-migrate/migrate#69
Open

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

wrrn opened this issue Jun 22, 2017 · 1 comment · Fixed by golang-migrate/migrate#69

Comments

@wrrn
Copy link

wrrn commented Jun 22, 2017

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)
@RyanDeng
Copy link

Meet the same bug here and do the fix #324

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants