Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在ubuntu 16.04上安装mysql服务器_Mysql_Terminal_Ubuntu 16.04 - Fatal编程技术网

无法在ubuntu 16.04上安装mysql服务器

无法在ubuntu 16.04上安装mysql服务器,mysql,terminal,ubuntu-16.04,Mysql,Terminal,Ubuntu 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/apparmo

这是当我试图使用命令-

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次删除、清除和所有其他命令,但都没有成功

而且

正在显示

AppArmor parser error for /etc

请帮助

尝试删除apparmor软件包:

sudo apt purge apparmor 
然后使用mysql公共包重新尝试安装:

sudo apt install mysql-common mysql-server

谢谢你!!!!成功了。我是stackoverflow的不速之客,因此我无法支持你的解决方案。抱歉…@user8147468如果您希望接受答案,请单击该答案旁边的复选标记,将其从灰色变为已填写。
sudo apt install mysql-common mysql-server