vim /etc/my.cnf
添加一行语句: validate_password=OFF
保存退出。
service mysqld restart 重启mysql服务
查看初始密码
grep 'A temporary password' /var/log/mysqld.log |tail -1
修改新密码
ALTER USER 'root'@'localhost' IDENTIFIED BY "123456";
vim /etc/my.cnf
添加一行语句: validate_password=OFF
保存退出。
service mysqld restart 重启mysql服务
查看初始密码
grep 'A temporary password' /var/log/mysqld.log |tail -1
修改新密码
ALTER USER 'root'@'localhost' IDENTIFIED BY "123456";