无法复位root用户的密码后,重启MySQL在CentOS 7

问题描述 投票:1回答:1

我已经使用以下步骤重新设置MySQL root用户密码

  1. 停止MySQL的

# systemctl stop mysqld

  1. 启动安全模式

# mysqld_safe --skip-grant-tables &

  1. 以root身份登录

# mysql -u root

  1. 重设密码

use mysql;

update user set password=PASSWORD("newpassword") WHERE user='root';

flush privileges;

quit;

  1. 停止MySQL的安全模式

# systemctl stop mysqld

  1. 启动MySQL

# systemctl start mysqld

I am getting the following message when trying to restart

# systemctl restart mysqld

Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

[root@li1456-180 ~]# systemctl status mysqld.service

● mysqld.service - MySQL Community Server

   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

   Active: failed (Result: start-limit) since Tue 2016-04-26 07:23:19 UTC; 10s ago

  Process: 13293 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)

  Process: 13292 ExecStart=/usr/bin/mysqld_safe (code=exited, status=1/FAILURE)

  Process: 13280 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)

 Main PID: 13292 (code=exited, status=1/FAILURE)

Apr 26 07:23:18 li1456-180.members.linode.com systemd[1]: Failed to start MySQL Community Server.

Apr 26 07:23:18 li1456-180.members.linode.com systemd[1]: Unit mysqld.service entered failed state.

Apr 26 07:23:18 li1456-180.members.linode.com systemd[1]: mysqld.service failed.

Apr 26 07:23:19 li1456-180.members.linode.com systemd[1]: mysqld.service holdoff time over, scheduling restart.

Apr 26 07:23:19 li1456-180.members.linode.com systemd[1]: start request repeated too quickly for mysqld.service

Apr 26 07:23:19 li1456-180.members.linode.com systemd[1]: Failed to start MySQL Community Server.

Apr 26 07:23:19 li1456-180.members.linode.com systemd[1]: Unit mysqld.service entered failed state.

Apr 26 07:23:19 li1456-180.members.linode.com systemd[1]: mysqld.service failed.

我缺少的东西吗?

mysql centos lamp
1个回答
0
投票

我很肯定的答案是/var/log/messages

在另一端:

tail -f /var/log/messages | grep -i mysql

重启MySQL

systemctl restart mysqld

检查日志,发现错误,如果仍然无法解决,请张贴所以我们可以帮助你。

© www.soinside.com 2019 - 2024. All rights reserved.