CentOs 7 mysql安装后会生成一个随机密码,通过命令查看: cat /var/log/mysqld.log |grep password 再次连接mysql,成功: 转载于:https://www.cnblogs.com/love-wife/p/10881300.html