ziutek / mymysql

MySQL Client API written entirely in Go
Other
735 stars 161 forks source link

mysql 8.0 caching_sha2_password auth plugin support #141

Closed martianzhang closed 6 years ago

martianzhang commented 6 years ago

As Issue #140 described, in MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.

https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html

Codes change mostly reference go-sql-driver/mysql

Use Example:

db := mysql.New(proto, "", addr, user, pass, dbname, "caching_sha2_password")
martianzhang commented 6 years ago

After test with cachingSha2PasswordPerformFullAuthentication, there are some wired error...

ziutek commented 6 years ago

The partial solution to support SHA authentication plugin can be to introduce another New* function and leave New in original form. This allows to use MySQL8 and do more experiments without breaking old software.