2017-06-12 193 views
2

这在终端输出来当我试图使用命令安装MySQL - 服务器 -无法安装ubuntu上的MySQL服务器16.04

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 

请帮

回答

3

尝试删除AppArmor的包:

sudo apt purge apparmor 

,然后重新尝试与mysql-安装commo n包:

sudo apt install mysql-common mysql-server 
+0

谢谢男人!!!!有效 。我是一个noobie stackoverflow,因为我不能upvote你的解决方案。对不起..... – prat14k

+0

@ user8147468如果您想接受答案,请点击该答案旁边的复选标记,将其从灰色转为填充。 –