mysql_native_password is deprecated and needs to be replaced with caching_sha2_password #271

Closed
opened 2026-04-05 20:26:21 +02:00 by MrUnknownDE · 0 comments
Owner

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 then systemctl restart mysql the error logs lines are still getting generated. So I am unsure what user in CloudPanel is causing this issue, possibly the mysql root?

*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 then `systemctl restart mysql` the error logs lines are still getting generated. So I am unsure what user in CloudPanel is causing this issue, possibly the mysql root?
Sign in to join this conversation.