gpt4 book ai didi

mysql服务在centos 7中没有启动

转载 作者:行者123 更新时间:2023-12-04 19:39:43 30 4
gpt4 key购买 nike

我在我的 centos 7.9 机器上安装了 mysql-community-server,它的服务没有启动并且在启动服务时给我错误,因为我也无法运行 mysql_secure_installation 脚本
这是我在启动服务时遇到的错误

 systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
这是日志详细信息
 tail -n 20 /var/log/mysqld.log
2021-11-30T09:38:45.003421Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-11-30T09:38:45.045895Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2021-11-30T09:38:45.045946Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2021-11-30T09:38:45.045966Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2021-11-30T09:38:45.045981Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2021-11-30T09:38:45.045997Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2021-11-30T09:38:50.955262Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 55847
2021-11-30T09:38:51.008326Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-11-30T09:38:51.036852Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2021-11-30T09:38:51.036942Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2021-11-30T09:38:51.036968Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2021-11-30T09:38:51.036983Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2021-11-30T09:38:51.037057Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2021-11-30T09:38:57.011572Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 55900
2021-11-30T09:38:57.034554Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-11-30T09:38:57.062981Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2021-11-30T09:38:57.063054Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2021-11-30T09:38:57.063079Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2021-11-30T09:38:57.063101Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2021-11-30T09:38:57.063118Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
我已经尝试了所有解决方案,但无法弄清楚它有什么问题。
这是我的/etc/my.conf 文件详细信息。
# 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

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

最佳答案

您正在运行 CentOS 7。运行以下命令:
systemctl 状态 mysqld.service
如果没有出现错误,试试这个:
systemctl 重启 mysqld.service
如果失败,请运行以下命令:
对于我在 ps auxf|grep mysqld|grep "grep" -v|awk '{print $2}' ;杀死 -9 $i;完毕
然后,运行这个:
systemctl 启动 mysqld.service
最后,为了确保它正常工作:
systemctl 状态 mysqld.service

关于mysql服务在centos 7中没有启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70167244/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com