我在 CentOS 7 上使用 Plesk 17 onyx。我已通过 plesk 更新管理器更新了我的服务器,但突然我的数据库服务器停止工作。我使用 MariaDB 作为数据库服务器。Plesk 也无法正常工作。
当我尝试启动、重新启动 MariaDB 时,发现输出以下错误。
Redirecting to /bin/systemctl status -l mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2016-12-13 13:41:00 PKT; 10min ago
Process: 8193 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 8192 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 8164 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 8192 (code=exited, status=0/SUCCESS)
Dec 13 13:40:57 ns*.ip-19***** systemd[1]: Starting MariaDB database server...
Dec 13 13:40:57 ns*.ip-19***** mysqld_safe[8192]: 161213 13:40:57 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Dec 13 13:40:57 ns*.ip-19***** mysqld_safe[8192]: 161213 13:40:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Dec 13 13:41:00 ns*.ip-19***** mysqld_safe[8192]: 161213 13:41:00 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
Dec 13 13:41:00 ns*.ip-19***** systemd[1]: mariadb.service: control process exited, code=exited status=1
Dec 13 13:41:00 ns*.ip-19***** systemd[1]: Failed to start MariaDB database server.
Dec 13 13:41:00 ns*.ip-19***** systemd[1]: Unit mariadb.service entered failed state.
Dec 13 13:41:00 ns*.ip-19***** systemd[1]: mariadb.service failed.
我也尝试过通过 plesk 以下命令修复 mysql
plesk help repair mysql
登录/var/log/mariadb/mariadb.log
161213 14:01:15 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 155782156
161213 14:01:15 [Note] Plugin 'FEEDBACK' is disabled.
161213 14:01:15 [ERROR] /usr/libexec/mysqld: unknown option '--safe-show-database'
161213 14:01:15 [ERROR] Aborting
161213 14:01:15 InnoDB: Starting shutdown...
161213 14:01:16 InnoDB: Shutdown completed; log sequence number 155782156
161213 14:01:16 [Note] /usr/libexec/mysqld: Shutdown complete
161213 14:01:16 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
答案1
似乎您正在为 MariaDB 重复使用旧版本的 MySQL 配置文件。出现错误提示unknown option '--safe-show-database'
,如果您查看与该选项相关的文档,您会发现它已被弃用:
http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_safe-show-database
此选项已弃用,不会执行任何操作,因为存在 SHOW DATABASES 权限,可用于控制每个帐户对数据库名称的访问。请参阅第 6.2.1 节“MySQL 提供的权限”。--safe-show-database 已在 MySQL 5.5.3 中删除。
您必须进入 my.cnf 或 MariaDB 启动脚本,找到该选项并将其删除。