当前位置:   article > 正文

Linux 搭建 Mysql8 服务器后,出现启动失败的问题_mysqld.service: failed with result 'exit-code'.

mysqld.service: failed with result 'exit-code'.
[root@instance-7m3omjg9 /]# systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2020-08-07 09:47:21 CST; 1min 45s ago
  Process: 11782 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=0/SUCCESS)
  Process: 11779 ExecStart=/usr/libexec/mysqld --basedir=/usr (code=exited, status=1/FAILURE)
  Process: 11742 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
  Process: 11718 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 11779 (code=exited, status=1/FAILURE)
   Status: "Server startup in progress"
    Error: 2 (No such file or directory)
 
Aug 07 09:47:20 instance-7m3omjg9 systemd[1]: Starting MySQL 8.0 database server...
Aug 07 09:47:21 instance-7m3omjg9 systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
Aug 07 09:47:21 instance-7m3omjg9 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Aug 07 09:47:21 instance-7m3omjg9 systemd[1]: Failed to start MySQL 8.0 database server.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

首先检查了 mysqld.log 日志,得到了报错的日志信息

2020-08-07T01:38:36.676475Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2020-08-07T01:38:36.676521Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2020-08-07T01:38:36.676691Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-08-07T01:38:36.677724Z 0 [ERROR] [MY-010119] [Server] Aborting
  • 1
  • 2
  • 3
  • 4

根据日志信息知道了是 ‘ibdata1’ 数据文件必须是可写的
所以更改权限即可
输入
chmod -R 777 /var/lib/mysql
然后重新启动服务
service mysqld start
启动完成后检查服务是否启动成功即可!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/628134
推荐阅读
相关标签
  

闽ICP备14008679号