mysql8.0以下的版本
将用户root的密码改为123456
set password for root@localhost = password('123456');
mysql8.0及以上的版本
将用户root的密码改为123456
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
将用户root的密码改为123456
set password for root@localhost = password('123456');
将用户root的密码改为123456
alter user 'root'@'localhost' identified with mysql_native_password by '123456';