(1)、在终端输入
mysql -u root -p
输入密码后即可进入mysql的运行环境
(2)、执行下面语句修改root用户的密码:
1、 alter user 'root'@'localhost' identified with mysql_native_password by 密码;
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
2、flush privileges;
(3)、退出mysql: