sudo mysqld_safe --skip-grant-tables
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
mysql -u root
use mysql;
UPDATE user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
sudo /etc/init.d/mysql restart
sudo mysql
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'root';
FLUSH PRIVILEGES;
Voir https://stackoverflow.com/questions/50691977/how-to-reset-the-root-password-in-mysql-8-0-11