Mysql authentication plugin error messages

Just checked in with mysql error logs trying to debug another problem and noticed a lot of these lines – about one a second – in the mysql error.log.

[Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

I’ve checked the user table and see that indeed the matomo user is using the wrong plugin, and that the default is set to caching_sha2.

mysql -e "select Host,User,plugin FROM  mysql.user;"
| Host      | User             | plugin                |
| localhost | debian-sys-maint | caching_sha2_password |
| localhost | matomo           | mysql_native_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session    | caching_sha2_password |
| localhost | mysql.sys        | caching_sha2_password |
| localhost | root             | auth_socket           |

mysql -e " show variables like 'default_authentication_plugin';"
| default_authentication_plugin | caching_sha2_password |

Can I update matomo user to use the suggested plugin, without destroying everything? (and if I do, will that get rid of the mysql errors?)

Suggested approach is take a backup of the user table (natch)
mysqldump mysql user > mysql.user.sql
mysql -e "ALTER USER 'matomo'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'same-as-original-password';"

Having looked back in my setup notes, I can see that I was the one who created the matomo db user, so I guess this is not a matomo question, but a mysql one. Apologies for the intrusion.
For the record, I ran the ALTER USER query above and it worked.

1 Like