进入mysql bin目录进行命令操作
mysql -u root -p
登录成功后修改密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
刷新权限以确保更改生效:
FLUSH PRIVILEGES;