centos7下 mysql5.7.9(8.0)啓動失敗問題

在CentOS7下yum方式安裝mysql正常,啓動服務時失敗,提示內容如下
服務啓動錯誤
輸入命令systemctl status mysqld.service查看錯誤信息

[root@qin-server ~]# systemctl status mysqld.service
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-11-07 15:49:21 CST; 17s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 7553 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
  Process: 7532 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 7553 (code=exited, status=1/FAILURE)
   Status: "SERVER_BOOTING"
    Error: 2 (No such file or directory)

Nov 07 15:49:20 qin-server systemd[1]: Starting MySQL Server...
Nov 07 15:49:21 qin-server systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Nov 07 15:49:21 qin-server systemd[1]: Failed to start MySQL Server.
Nov 07 15:49:21 qin-server systemd[1]: Unit mysqld.service entered failed state.
Nov 07 15:49:21 qin-server systemd[1]: mysqld.service failed.

輸入命令cat /var/log/mysqld.log查看具體錯誤日誌,

[root@qin-server ~]# cat /var/log/mysqld.log
2018-11-07T07:49:21.209540Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 7553
2018-11-07T07:49:21.313370Z 1 [ERROR] [MY-013090] [InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9
2018-11-07T07:49:21.313449Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2018-11-07T07:49:21.914145Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2018-11-07T07:49:21.914465Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-11-07T07:49:21.914499Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-11-07T07:49:21.915406Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13)  MySQL Community Server - GPL.
[root@qin-server ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server=UTF8MB4
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

在/var/lib/mysql下新建了一個data文件夾,修改my.cnf文件,datadir=/var/lib/mysql/data
保存之後,啓動mysql服務竟然成功了!作爲一個二把刀,實在講不清爲什麼,新建data文件夾是借鑑了mysql-5.7.12-winx64安裝的時候無法啓動服務問題,特此記錄。

[root@qin-server ~]# systemctl start mysqld.service
[root@qin-server ~]# 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章