When installing WordPress using MySQL 8, the following error may occur:
Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
The reason is the default authorization method.
In the file "/etc/my.cnf" in the block "mysqld" add the following:
And restart the mysqld service:
systemctl restart mysqld
If the user has already been created using the "caching_sha2_password" method, then you need to log in to mysql and do the following:
alter user 'username'@'localhost' identified with mysql_native_password by 'password';