gutmensch / docker-dmarc-report

229 stars 26 forks source link

error with mysql 8 database #10

Closed cybermcm closed 3 years ago

cybermcm commented 3 years ago

First of all, great thing you built!

Recently switched to mysql 8. dmarc-report shows following error:

Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in /var/www/viewer/dmarcts-report-viewer.php on line 178

Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in /var/www/viewer/dmarcts-report-viewer.php on line 178
Error: Failed to make a MySQL connection
Errno: 2054 Error: The server requested authentication method unknown to the client

I'm not a programmer but it seems that the mysql wrapper can't understand caching_sha2_password.

Tried to add the db user with mysql_native_password but didn't work.

Switching back to mysql5 -> no problem.

any ideas how to solve this on your end?

gutmensch commented 3 years ago

Hey @cybermcm , great to hear you find it useful! To be honest I expected those errors to pop up at some point, because the originating image with alpine/fpm/php is pretty old. If you tried with altering the user to mysql_native_password and/or tried to make mysqld to this password method (see [1]) I am also out of ideas for now. The base image should be bumped to latest mysql clients to also support mysql 8 - I'll very likely look at this during the upcoming holiday season, but I suspect a bit more work to come up here.

[1]

sql> -- alter user to use mysql native password method
sql> ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';

# mysqld daemon my.cnf and restart
[mysqld]
default_authentication_plugin=mysql_native_password
cybermcm commented 3 years ago

I did try to change the specific mysql user to mysql native password, it didn't work. I didn't try to switch the standard mysql authentication (like you mentioned with mysqld) because dmarc-report is currently my only application which doesn't support mysql 8. Looking forward to your solution. Thanks again for taking a look into it.

cybermcm commented 3 years ago

Thank you!