ER_NOT_SUPPORTED_AUTH_MODE - 帆 1.0 和 MySQL 8.0
ER_NOT_SUPPORTED_AUTH_MODE - sails 1.0 and MySQL 8.0
我正在尝试将 SailsJS 与 MySQL
连接
default: {
adapter: require('sails-mysql'),
url: 'mysql://root:root@localhost/ventas'
},
但是每当我执行 'sails lift' 时,我都会收到以下错误:
error: A hook (`orm`) failed to load!
error:
error: { error:
{ Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (C:\ticket\node_modules\mysql\lib\protocol\sequences\Sequence.js:48:14) }
我只是使用 sails 附带的网络应用程序模板,没有添加任何代码。
有什么想法吗?
问题出在mysql
,您需要将插件更改为mysql_native_password
,然后flush privileges;
,参见here and here。
将您的密码设置为大写、小写、数字和一个特殊字符,长度为 8 个字母。
问题可能与加密密码有关。 MySQL 8.0 使用 caching_sha2_password。您需要将其更改为 mysql_native_password:
ALTER USER 'user' identified with mysql_native_password BY 'password';
我正在尝试将 SailsJS 与 MySQL
连接default: {
adapter: require('sails-mysql'),
url: 'mysql://root:root@localhost/ventas'
},
但是每当我执行 'sails lift' 时,我都会收到以下错误:
error: A hook (`orm`) failed to load!
error:
error: { error:
{ Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (C:\ticket\node_modules\mysql\lib\protocol\sequences\Sequence.js:48:14) }
我只是使用 sails 附带的网络应用程序模板,没有添加任何代码。
有什么想法吗?
问题出在mysql
,您需要将插件更改为mysql_native_password
,然后flush privileges;
,参见here and here。
将您的密码设置为大写、小写、数字和一个特殊字符,长度为 8 个字母。
问题可能与加密密码有关。 MySQL 8.0 使用 caching_sha2_password。您需要将其更改为 mysql_native_password:
ALTER USER 'user' identified with mysql_native_password BY 'password';