r/learnreactjs • u/LieutenantNyan • Jul 05 '22
MySQL Client Authentication Protocol Error
I am in the process of learning ReactJS through a course on Udemy. When running the application, I am getting an error when the application starts and tries to connect to MySQL. Having a similar issue on both Windows 11 and MacOS.
https://github.com/jwstl/08-fetching-related-products
Package.json
{"name": "nodejs-complete-guide","version": "1.0.0","description": "Complete Node.js Guide","main": "app.js","scripts": {"test": "echo \"Error: no test specified\" && exit 1","start": "nodemon app.js","start-server": "node app.js"},"author": "Maximilian Schwarzmüller","license": "ISC","devDependencies": {"nodemon": "^1.18.3"},"dependencies": {"body-parser": "^1.18.3","ejs": "^2.6.1","express": "^4.16.3","express-handlebars": "^3.0.0","mysql2": "^1.6.1","pug": "^2.0.3","sequelize": "^5.0.0-beta.11"}}
Error Message:
PS G:\repos\NodeJSCourseFiles\08-fetching-related-products> npm start
> [email protected] start G:\repos\NodeJSCourseFiles\08-fetching-related-products
> nodemon app.js
[nodemon] 1.19.4
[nodemon] to restart at any time, enter \rs``
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting \node app.js``
ConnectionError [SequelizeConnectionError]: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:133:19
at tryCatcher (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\promise.js:725:18)
at _drainQueueStep (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (G:\repos\NodeJSCourseFiles\08-fetching-related-products\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:464:21) {
parent: Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
1
u/bdenzer Jul 07 '22
The course is using an older version of mysql. I didn't look into the course to see what steps they gave - but the solution is to use
mysql_native_password. You'll have to google the steps of updating your user - something like"mysql update user mysql_native_password"