mysql启动失败
来源:13-6 线上环境安装配置实操(mysql)

To_The_Moon
2017-12-18
因为是centos7的,按照帖子上说的
http://www.linuxidc.com/Linux/2016-09/135288.htm
安装的mysql是这样的。
[root@webvps ~]# rpm -qa | grep mysql
mysql57-community-release-el7-8.noarch
mysql-community-client-5.7.20-1.el7.x86_64
mysql-community-libs-5.7.20-1.el7.x86_64
mysql-community-libs-compat-5.7.20-1.el7.x86_64
mysql-community-common-5.7.20-1.el7.x86_64
mysql-community-server-5.7.20-1.el7.x86_64
报错信息
[root@izwz9d8jbsexysap7quc0hz etc]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
Job for mysqld.service failed because the control process exited with error code . See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@izwz9d8jbsexysap7quc0hz etc]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor prese t: disabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2017-12-18 18 :04:58 CST; 26ms ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 6820 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysql d/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 6797 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/ SUCCESS)
Dec 18 18:04:58 izwz9d8jbsexysap7quc0hz systemd[1]: Failed to start MySQL Ser...
Dec 18 18:04:58 izwz9d8jbsexysap7quc0hz systemd[1]: Unit mysqld.service enter...
Dec 18 18:04:58 izwz9d8jbsexysap7quc0hz systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
2回答
-
你好,因为课程不是centos7 ,我这没用centos7环境。。只能帮你找一下相关资料
http://blog.csdn.net/loveuserzzz/article/details/62036988
同学请看这里,看样子是一样的错误。
检查mysql的日志,是一个非常好的思路
042018-05-15 -
浣玉
2018-05-15
楼主怎么解决的啊?
我的是这样的;
[root@iZ2ze9fstvjqgx02nvyip7Z system]# systemctl start mysqld [root@iZ2ze9fstvjqgx02nvyip7Z system]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2018-05-15 01:15:43 CST; 28s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 30315 ExecStart=/usr/sbin/mysqld --defaults-file=/etc/my.cnf (code=exited, status=1/FAILURE) Main PID: 30315 (code=exited, status=1/FAILURE) May 15 01:15:41 iZ2ze9fstvjqgx02nvyip7Z systemd[1]: Started MySQL Server. May 15 01:15:41 iZ2ze9fstvjqgx02nvyip7Z systemd[1]: Starting MySQL Server... May 15 01:15:43 iZ2ze9fstvjqgx02nvyip7Z systemd[1]: mysqld.service: main process exited, code=exited, status=...LURE May 15 01:15:43 iZ2ze9fstvjqgx02nvyip7Z systemd[1]: Unit mysqld.service entered failed state. May 15 01:15:43 iZ2ze9fstvjqgx02nvyip7Z systemd[1]: mysqld.service failed. Hint: Some lines were ellipsized, use -l to show in full.
/usr/lib/systemd/system/mysqld.service 对应文件内容时:
[Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql ExecStart=/usr/sbin/mysqld --defaults-file=/etc/my.cnf LimitNOFILE = 5000 # Restart=on-failure # RestartPreventExitStatus=1 # PrivateTmp=false
下面是原有的mysqld.service文件内容:
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # systemd service file for MySQL forking server # [Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql Type=forking PIDFile=/var/run/mysqld/mysqld.pid # Disable service start and stop timeout logic of systemd for mysqld service. TimeoutSec=0 # Execute pre and post scripts as root PermissionsStartOnly=true # Needed to create system tables ExecStartPre=/usr/bin/mysqld_pre_systemd # Start main service ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS # Use this to switch malloc implementation EnvironmentFile=-/etc/sysconfig/mysql # Sets open_files_limit LimitNOFILE = 5000 Restart=on-failure RestartPreventExitStatus=1 PrivateTmp=false
132018-05-19
相似问题