1.在部署完数据库之后,过滤出初始密码,grep 'password' /var/log/mysqld.log
2.然后改密码, mysqladmin -uroot -p'es,W;ya(K1Th' password 'QianFeng@123'
3.mysql -uroot -p'QianFeng@123'登录,结果报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
4.此时查一下状态,检查防火墙,selinux等。
5.然后进入vi /etc/my.cnf配置文件,在"mysqld"下加入skip-grant-tables就行。重启mysqld即可登录。