1

I'm running Ubuntu 20.10 and trying to install MySql server. I previously had an error connecting to the DB and a different article suggested purge and reinstall. I have tried searching for the error, but couldn't find any relevant help. Here is the output during apt intall:

sudo apt install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  mysql-client-8.0 mysql-server-8.0
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-client-8.0 mysql-server mysql-server-8.0
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,355 kB of archives.
After this operation, 1,798 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-client-8.0.
(Reading database ... 270231 files and directories currently installed.)
Preparing to unpack .../mysql-client-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-server-8.0.
Preparing to unpack .../mysql-server-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Unpacking mysql-server-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.23-0ubuntu0.20.10.1_all.deb ...
Unpacking mysql-server (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-client-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-server-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld: Can't open shared library '/usr/lib/mysql/plugin/component_reference_cache.so' (errno: 0 /us
r/lib/mysql/plugin/component_reference_cache.so: cannot open shared object file: No such file or dir
ectory)
mysqld: Cannot load component from specified URN: 'file://component_reference_cache'.
mysqld will log errors to /var/lib/mysql/david-laptop.err
mysqld is running as pid 12368
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysq
l.service.
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: activating (auto-restart) (Result: exit-code) since Thu 2021-03-04 17:56:43 EST; 4ms ag
o
    Process: 12506 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAIL
URE)
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous fa ilure. Processing triggers for man-db (2.9.3-2) ... Processing triggers for systemd (246.6-1ubuntu1.1pop0~1613764432~20.10~90cdde7) ... Errors were encountered while processing: mysql-server-8.0 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried following these instructions to uninstall How do I uninstall MySQL completely? and then reinstalled and got a little different error:

The following NEW packages will be installed:
  mysql-client-8.0 mysql-client-core-8.0 mysql-server mysql-server-8.0 mysql-server-core-8.0
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.7 MB of archives.
After this operation, 188 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-client-core-8.0.
(Reading database ... 269893 files and directories currently installed.)
Preparing to unpack .../mysql-client-core-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-server-8.0.
Preparing to unpack .../mysql-server-8.0_8.0.23-0ubuntu0.20.10.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Unpacking mysql-server-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.23-0ubuntu0.20.10.1_all.deb ...
Unpacking mysql-server (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-client-core-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-server-core-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-client-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Setting up mysql-server-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/lib/mysql/david-laptop.err
mysqld is running as pid 16985
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in profile /etc/apparmor.d/usr.sbin.mysqld
 at line 9: Could not open 'abstractions/mysql'
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysq
l.service.
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: activating (auto-restart) (Result: exit-code) since Thu 2021-03-04 18:31:40 EST; 4ms ag
o
    Process: 17178 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAIL
URE)
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous fa ilure. Processing triggers for man-db (2.9.3-2) ... Processing triggers for systemd (246.6-1ubuntu1.1pop0~1613764432~20.10~90cdde7) ... Errors were encountered while processing: mysql-server-8.0 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

And now I get the same error as above when I try to purge.

After messing around and reading ALOT of different help articles, I have resolved most errors. But this is where I'm stuck now:

2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-8.0 (8.0.23-0ubuntu0.20.10.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/lib/mysql/david-laptop.err
mysqld is running as pid 15970
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: activating (auto-restart) (Result: exit-code) since Thu 2021-03-04 20:51:43 EST; 4ms ag
o
    Process: 16138 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAIL
URE)
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous fa
ilure.
      dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: mysql-server-8.0 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

dareblue
  • 11
  • 2
  • Do you have a /var/log/mysql directory? If so, can you post some of the most recent error reports? That will make it easier to suggest a solution –  Mar 05 '21 at 01:21
  • I gave up and uninstalled MySql and downloaded the community edition from the MySql website and that installed without any issues. Unfortunately we'll never know why it was broke, but now I have a working MySql server now. – dareblue Mar 06 '21 at 21:50

1 Answers1

0

The most interesting error in your output is the following:

AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in profile /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'

The mentioned abstractions/mysql file came from apparmor package. You have to reinstall it using command below:

sudo apt-get install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" apparmor

Then resume installation of MySQL server.

N0rbert
  • 99,918