migrate icon indicating copy to clipboard operation
migrate copied to clipboard

MySQL driver can't handle non-alphanumeric passwords

Open wrrn opened this issue 7 years ago • 1 comments

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)

wrrn avatar Jun 22 '17 15:06 wrrn

Meet the same bug here and do the fix https://github.com/mattes/migrate/pull/324

RyanDeng avatar Dec 19 '17 08:12 RyanDeng