Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install mysql-server on ubuntu 16.04

This is the terminal output coming when i am trying to install the mysql-server using the command -

sudo apt-get install mysql-server

Terminal 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)

i have tried about 5 times just removing,purging and all other commands, but cannot get it done.

also,

systemctl mysql status

is showing

AppArmor parser error for /etc

Please help

like image 914
prat14k Avatar asked Mar 08 '23 21:03

prat14k


1 Answers

Try removing apparmor package:

sudo apt purge apparmor 

and then re-attempt the installation with mysql-common package:

sudo apt install mysql-common mysql-server
like image 57
mahyard Avatar answered Mar 31 '23 06:03

mahyard