11. If you in skip-grant-tables mode in mysqld_safe:
2
3mysql> UPDATE mysql.user SET authentication_string=null WHERE User='root';
4mysql> FLUSH PRIVILEGES;
5mysql> exit;
6
7and then, in terminal:
8
9$ mysql -u root
10
11in mysql:
12mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
13
14
152. Not in skip-grant-tables mode just in mysql:
16mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';