Problem
Start from MySQL 8, the authentication plugin is changed to "caching_sha2_password".
Therefore, phpMyAdmin or other client tools will get "Public Key Retrieval is not allowed" problem.
Solution
We changed the authentication plugin to "mysql_native_password".
If you use docker. You need do this first.
$ sudo docker exec -it docker_run_name bash
Example: $ sudo docker exec -it mysql bash
$ mysql -u root -p
mysql> use mysql
mysql> select host, user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
5 rows in set (0.00 sec)
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Your New Password';
Query OK, 0 rows affected (0.08 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
Test