ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
332 stars 133 forks source link

Could it work with Mysql 5.7.41? #207

Open LinXiaosen-China opened 1 year ago

LinXiaosen-China commented 1 year ago

I set up the correct account and password, but the serial monitor tells me "Error: 76 = Access denied for user 'root'@'192.168.0.111(using password: YES)'".

First, I thought it was a password error. BUT I successfully accessed Mysql from CMD with the same account and password.

Then, I tried to access Mysql from other computer (different IP Address but on the LAN), and it was successfully.

Next, I set Mysql config to skip password authentication, and esp8266 successfully connected to Mysql !

So, I try to look at the code, and I find this fuction "scramble_password()" that form a SHA1 hash of the password. The documentation online shows that this applies to version 3.2 - 4.0. BUT my Mysql's version is 5.7.41.

Can you help me with this problem? Thank you.

ChuckBell commented 1 year ago

Yes, the connector works with MySQL 5.7 (and 8.0). Please check that the user is set to use the native password plugin. The connector requires user accounts have the mysql_native_password plugin. See https://dev.mysql.com/doc/refman/8.0/en/native-pluggable-authentication.html.