mirror of
https://github.com/cloudpanel-io/cloudpanel-ce.git
synced 2026-04-05 20:31:58 +02:00
mysql_native_password is deprecated and needs to be replaced with caching_sha2_password #271
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jamiolee on 2/7/2024
CloudPanel version(s) affected
2.4.0
Description
All MySQL accounts created by CloudPanel are using mysql_native_password by default, and it's causing the MySQL error log at "/var/log/mysql/error.log" to generate a new a log line every time anyone hits the (WordPress/PHP) website.
Example log line:
2024-02-06T22:14:02.000394Z 134 [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'This is only a warning message so it's not crucial but it does quickly fill up the MySQL error log file on heavy traffic websites making debugging MySQL errors problematic. As mysql_native_password are now deprecated, they should be replaced with caching_sha2_password.
How to reproduce
Create a new site, either PHP or WordPress, then create a MySQL database. Visit the website and check the logs at "/var/log/mysql/error.log". Refresh the website and notice that the log populates a new entry with the warning for every page visit.
Possible Solution
Replace "mysql_native_password" with "caching_sha2_password" for all accounts created by CloudPanel.
Additional Context
I have tried updating the mysql user for the website to use "caching_sha2_password" instead but after running
FLUSH PRIVILEGES;and thensystemctl restart mysqlthe error logs lines are still getting generated. So I am unsure what user in CloudPanel is causing this issue, possibly the mysql root?