我已使用以下步骤重置MySQL root用户密码
# systemctl stop mysqld
# mysqld_safe --skip-grant-tables &
# mysql -u root
use mysql;
update user set password=PASSWORD("newpassword") WHERE user='root';
flush privileges;
quit;
# systemctl stop mysqld
# systemctl start mysqld
# 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.
我错过了什么吗?
答案 0 :(得分:0)
我非常确定答案是tail -f /var/log/messages | grep -i mysql
。
在另一个终端上:
systemctl restart mysqld
重启mysql
$doc
检查日志并找到错误,如果仍然无法解决,请发布,以便我们为您提供更多帮助。