Mysql: Add support for sha256_password pluggable authentication

Created on 27 Jun 2017  ·  4Comments  ·  Source: go-sql-driver/mysql

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

Edit: Note that support for caching_sha2_password is already implemented. See #794.

enhancement

Most helpful comment

Just a friendly note that with MySQL 8.0.4-rc comes a new default for authentication: caching_sha2_password is now used when creating users.

If you want to use a go-sql-driver/mysql supported authentication plugin, you have to create/alter users to use a different one.

As as workaround, you could use the MySQL Native Password plugin:

ALTER USER  'youruser'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'secret';

Note that you will need to explicitly set "allowNativePasswords=True" in the DSN.

(I did implement auth plugins in MySQL Connector/Python, I know the pain)

All 4 comments

It seems that is related on #552 , and the implement is depends on it will be accepted or not.

Previously I made a patch supporting auth switching to native password (sha1) on this and I definitely vote that we should start sha256 support now.

Just a friendly note that with MySQL 8.0.4-rc comes a new default for authentication: caching_sha2_password is now used when creating users.

If you want to use a go-sql-driver/mysql supported authentication plugin, you have to create/alter users to use a different one.

As as workaround, you could use the MySQL Native Password plugin:

ALTER USER  'youruser'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'secret';

Note that you will need to explicitly set "allowNativePasswords=True" in the DSN.

(I did implement auth plugins in MySQL Connector/Python, I know the pain)

Hello, if you are looking for help, MySQL engineers working on authentication plugins and connectors will be happy to assist you. You can reach us on the MySQL Community Slack (http://lefred.be/mysql-community-on-slack/). Keep the good work !
Cheers,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julienschmidt picture julienschmidt  ·  7Comments

xuewindy picture xuewindy  ·  3Comments

albrow picture albrow  ·  7Comments

victormongi picture victormongi  ·  4Comments

jaysonShao picture jaysonShao  ·  3Comments