找到mysql root密码centos 7

我在Centos 7上安装了Mysql服务器,但找不到临时密码 . 我这样做:grep'临时密码'/var/log/mysqld.log但是我没有结果 .

谢谢 .

回答(1)

3 years ago

如果正确安装了MySql,grep应该显示结果 .

请确保:

1) Mysql service is running :

service mysqld status

要确保它随系统启动一起启动:

systemctl start mysqld

2) Running grep with Root user

sudo grep 'temporary password' /var/log/mysqld.log

3) /etc/my.cnf should display logging entry or similar :

log = /var/log/mysqld.log
log-error = /var/log/mysqld.error.log