MySQL 8.0: The server requested authentication method unknown to the client

Итак, вы получили подобную ошибку от MySQL сервера:

#2054 - The server requested authentication method unknown to the client
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client

Что делать?

Нужно выполнить в консоли:

mysql -u root -pPASSWORD

А затем выполнить запрос:

ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';

Где PASSWORD — пароль пользователя.