将 "safe-show-database"添加到 my.cnf 文件时,Mysqld 服务在启动时挂起

标签 mysql centos7 systemd

我在最小的 Centos 7 机器上新安装了 Mysqld 5.6.33。

它通过以下/ec/my.cnf 文件成功启动:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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 = 728M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
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
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

但是当我将“safe-show-database”行添加到 [mysqld] 时,它停止启动,永远处于该状态

sudo systemctl status mysqld -l
● mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: activating (start-post) since T  2016-09-14 13:03:04 UTC; 4s ago
  Process: 1580 ExecStart=/usr/bin/mysqld_safe (code=exited, status=0/SUCCESS)
  Process: 1569 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 1580 (code=exited, status=0/SUCCESS);         : 1584 (mysql-systemd-s)
   CGroup: /system.slice/mysqld.service
           └─control
             ├─1584 /bin/bash /usr/bin/mysql-systemd-start post
             └─1851 sleep 1

sep 14 13:03:04 db systemd[1]: Starting MySQL Community Server...
sep 14 13:03:04 db mysqld_safe[1580]: 160914 13:03:04 mysqld_safe Logging to '/var/log/mysqld.log'.
sep 14 13:03:04 db mysqld_safe[1580]: 160914 13:03:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

日志中什么也没有。

我尝试禁用 SELinus,但没有成功。

我还应该做什么来解决这个问题?

最佳答案

来自docs : “--safe-show-database 在 MySQL 5.5.3 中已被删除。”

关于将 "safe-show-database"添加到 my.cnf 文件时,Mysqld 服务在启动时挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39491394/

相关文章:

php - 查找非重复记录

php - 如何在单个代码中使用两个 mysql_query 和两个 mysql_fetch_assoc

php - 更改 session 变量的值

mysql - 为什么 Centos 上的 MySQL 5.6.38 打开文件描述符的数量如此之多?

带有全文索引的 mysql View

centos7 - zabbix agent服务失败,PID不可读

linux - 为什么 Ubuntu 18.04 使用 `/sbin/init` 而不是 `systemd` ?

docker - 在主管的监督下保持活跃的Docker容器

systemd - 无法使用 systemd 启动 prometheus

linux - 在 bash 中将 apache 日志日期格式转换为纪元