MySQL Auth Mode Error - Fixed!

preview_player
Показать описание
If you're seeing 'ER_NOT_SUPPORTED_AUTH_MODE' or 'Client does not support authentication protocol requested by server; consider upgrading MySQL client', this is how you fix it 👍.

The snippet I paste in the Workbench is here for you to copy:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'

Hope it helps and thanks for watching!

Affiliate links to some of my gear 🤘🙏❤️
(Best quality for the best price from my research)
Рекомендации по теме
Комментарии
Автор

Thank you soo much. I was unable to remove that error since 2-3 days and after watching this video my error has been resolved .Thank you soo much

jyotipandey
Автор

An explanation of this error is that mysql in a specific version has removed default support for creds being passed as plain text and now prefer some sort of encrypted alternative when establishing the connection to the database. Which creates an issue because the node package mysql (which many people use when dev an app with nodejs backend), does not support this new encrypted creds thing, yet. So basically when you establish a connection using the mysql node package you are passing the creds in plain text and when the mysql server gets that request it throws the error saying it's not supported anymore.

Now, the "weird" thing is that I'm not experiencing this issue on my development machine, but I am experiencing it once I deploy the application on the server. I think it's because on my dev machine I'm using MAMP instead of plain mysql, which means MAMP is using an outdated version of mysql. While on the deployment server I use mysql v8.4.x (which is currently the LTS).
Obviously on the deployment server I do not have a GUI and as such I can't run mysql workbench like you did to solve the issue, but it should have the same result if I just login with my sql root creds and execute that line of code. And I've tried to do so, but at that point it gives me an error saying that the module for the native password is not found: "ERROR 1524: Plugin 'mysql_native_password' is not loaded". So the devs of mysql have removed it as a plugin and it can no longer be activated with that specific query you showed. Which deems this tutorial video you did, practically useless. Unless people are using older version of mysql on purpose (which I don't recommend, but you do you).
Finally I've tried to look online for a fix and read through the docs of mysql (which btw suck, they should get their shit together and create some decent docs already) and I've finally understood what the problem is (I've explained it above).
The fix I've found was mentioned in official mysql bug reports: "Bug #114876 - Inconsistent error for bad user when mysql_native_password=OFF". And basically to fix the issue apparently we have to get into the configuration file of mysql (usually located at /etc/mysql/my.cnf) and add the line "mysql_native_password=ON", then of course restart the mysql service.

All this to say: this video shows a solution for an outdated version of mysql. If you are using v8.4.x or newer and for some reason need to pass creds in plain text, you need to edit the mysql conf file adding the line "mysql_native_password=ON".

croluy
Автор

It worked for me, thanks for your help. I struggled for a half of the day after found you.

Nam_David
Автор

it doesnt work for me... any other ideas?

TheDriver_wheelie
Автор

This solution is suggested on many, many websites and videos but it does not work for me. The simple connection example code still fails with ER_NOT_SUPPORTED_AUTH_MODE. I'm going crazy trying to figure this out.

ubist
Автор

You're a LIFE SAVER. Thank you so much!

archangel
Автор

Thx mate~
BTW just wondering the reason why this happened?
Did everyone including me just mis-set something?

mikeyTheDev
Автор

Yoy are better than a.i, in my case. Thanks.

filipjuza
Автор

Its worked. Tks you so muck. +1 like and + 1 sub

bekonnguyen