我正在使用 ubuntu 16.04,但是可以说我对这个主题还不太熟悉。
当我想要安装 MariaDB 时,我已经安装了 Mysql,在安装过程中,MariaDB 似乎强制卸载了 Mysql 来代替它。但是,当我尝试启动服务器时,出现以下情况:
Configuring mariadb-server-10.1 (10.1.22-3) ...
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Fri 2017-05-26 00:52:18 CEST; 11ms ago
Process: 14410 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 14320 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 14316 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 14314 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 14410 (code=exited, status=0/SUCCESS)
mai 26 00:50:45 jaeger767-OMEN systemd[1]: Starting MariaDB database server...
mai 26 00:50:46 jaeger767-OMEN mysqld[14410]: 2017-05-26 0:50:46 140701379916352 [Note] /usr/sbin/mysqld (mysqld 10.1.22-MariaDB-) starting as process 14410 ...
mai 26 00:52:16 jaeger767-OMEN systemd[1]: mariadb.service: Start operation timed out. Terminating.
mai 26 00:52:18 jaeger767-OMEN systemd[1]: Failed to start MariaDB database server.
mai 26 00:52:18 jaeger767-OMEN systemd[1]: mariadb.service: Unit entered failed state.
mai 26 00:52:18 jaeger767-OMEN systemd[1]: mariadb.service: Failed with result 'timeout'.
dpkg:
Package processing error mariadb-server-10.1 (--configure) : the under-process script post-installation returned an exit error code 1
现在我无法卸载 MariaDB,除非 Ubuntu 想要配置它,而且我不知道如何解决这个问题,我在 StackExchange 上找到了一些关于这个问题的内容,但没有用
先感谢您
答案1
正如 ChrisAga 在评论中所说的那样:
看 :askubuntu.com/questions/750604/…问题的解释及其解决方法。
这是一个 AppArmor 问题,可以通过将 AppArmor 配置为仅抱怨 mysqld 进程来解决。
以下是该链接中接受的答案的命令的摘要。
sudo apt-get install apparmor-utils
sudo aa-complain /usr/sbin/mysqld
sudo service apparmor reload
sudo systemctl start mariadb