无法在ubuntu 16.04

时间:2017-06-12 09:14:11

标签: mysql terminal ubuntu-16.04

当我尝试使用命令 -

安装mysql-server时,这是终端输出
sudo apt-get install mysql-server

终端o / p

Setting up mysql-community-server (5.7.18-1ubuntu16.04) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 7: Could not open 'abstractions/mysql'
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-06-12 14:23:11 IST; 7ms ago
  Process: 26677 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 26612 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 23756 (code=exited, status=1/FAILURE)

Jun 12 14:23:06 prat14k systemd[1]: Starting MySQL Community Server...
Jun 12 14:23:07 prat14k mysql-systemd-start[26612]: AppArmor parser error for...
Jun 12 14:23:07 prat14k mysqld[26677]: Initialization of mysqld failed: 0
Jun 12 14:23:07 prat14k systemd[1]: mysql.service: Control process exited, ...=1
Jun 12 14:23:11 prat14k systemd[1]: Failed to start MySQL Community Server.
Jun 12 14:23:11 prat14k systemd[1]: mysql.service: Unit entered failed state.
Jun 12 14:23:11 prat14k systemd[1]: mysql.service: Failed with result 'exit...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package mysql-community-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-community-server (= 5.7.18-1ubuntu16.04); however:
  Package mysql-community-server is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu7) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-community-server
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试了大约5次删除,清除和所有其他命令,但无法完成它。

systemctl mysql status

正在显示

AppArmor parser error for /etc

请帮忙

1 个答案:

答案 0 :(得分:6)

尝试删除apparmor包:

sudo apt purge apparmor 

然后使用mysql-common软件包重新尝试安装:

sudo apt install mysql-common mysql-server