我在 nodejs(v6.11.0) 应用程序上使用 Sequelize 版本 4.3.0,该应用程序具有 Mariadb (mysql Ver 15.1 Distrib 10.0.29-MariaDB,用于 debian-linux-gnu (i686),使用 readline 5.2
) 在 Ubuntu 16.04 上。
当应用程序启动并调用函数时:
Sequelize.sync();
然后sequelize连接管理器抛出如下错误:
Unhandled rejection SequelizeConnectionError: Client does not support authentication protocol requested by server; consider upgrading MariaDB client
at Utils.Promise.tap.then.catch.err (/home/dariksoft/cars/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:146:17)
at tryCatcher (/home/dariksoft/cars/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/dariksoft/cars/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/dariksoft/cars/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/dariksoft/cars/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/dariksoft/cars/node_modules/bluebird/js/release/promise.js:689:18)
at Async._drainQueue (/home/dariksoft/cars/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/dariksoft/cars/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/dariksoft/cars/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
我更新了 mariadb-server 和 mariadb-client 但问题已经存在!
谁能帮我解决这个问题?
最佳答案
我找到了答案:
登录mysql命令行并编写以下命令:
use mysql;
更新用户集 authentication_string=password(''),plugin='mysql_native_password' where user='root';
关于mysql - SequelizeConnectionError : Client does not support authentication protocol requested by server; consider upgrading MariaDB client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45051927/