come qui dice:
1.se sei in modalità skip-grant-tables
in mysqld_safe:
UPDATE mysql.user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
exit;
e poi, nel terminale:
mysql -u root
in MySQL:
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
2.non in modalità skip-grant-tables
solo in mysql:
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';