sebagai di sini mengatakan:
1.jika Anda dalam mode skip-grant-tables
di mysqld_safe:
UPDATE mysql.user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
exit;
dan kemudian, di terminal:
mysql -u root
di mysql:
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
2.tidak dalam mode skip-grant-tables
hanya di mysql:
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';