Sequelize does not suport the MySQL 8 autentication protocol and I'm not getting how to change this protocol

天大地大妈咪最大 提交于 2019-12-06 08:04:46

If you want to use MySQL 5.x style authentication, typically all you have to do is add this to your my.cnf:

[mysqld]
default_authentication_plugin=mysql_native_password

Do this before adding any users. Only use users for connecting via Sequelize, never root.

If you are using MySQL 8.0 then https://dev.mysql.com/doc/refman/5.6/en/validate-password-installation.html then this shouldn't work.

Have used mysql_secure_installation and installed the validate_password_component then?

If yes, in that case, the plugin must already be installed and all you need to do is set validate_password related parameters in the options file (default /etc/my.cnf) and some options require a server restart.

For those who cannot edit system variables (for instance, if you're using a managed database in AWS or DigitalOcean), this works as well:

ALTER USER 'foo'@'bar' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;

Or, if you cannot run flush privileges; like me:

DROP USER 'foo'@'bar';
CREATE USER 'foo'@'bar' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT INSERT, SELECT, ... ON mydb.* TO 'foo'@'bar';
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!