Score:1

Ubuntu 20.04 upgrade - mysql-server 8 not working

it flag

I have undertaken an upgrade of our Ubuntu server from 18 to 20.04. During the installation I had no errors reported and, once completed, I was able to log onto the server directly (through PuTTY) and all seemed fine.

However, this server is used as our Moodle server and the website failed (refused to connect).

One of our technicians sent me the following information...

On running the command sudo systemctl start apache2, we receive an error and prompt to run a status command.

On running the status command sudo systemctl status apache2, the server confirms that the apache2 service is reporting a syntax error on line 140 of /etc/apache2/apache2.conf. By catting this file (or better, opening to edit via WinSCP) we can see that line 140 has command IncludeOptional mods-enabled/*.load.

This command is attempting to import the auto_ntlm_winbind module, located at /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so which does not appear to exist. I've attempted to manually re-add the missing .so file but this has not changed the issue.

So, today I tried to reinstall Apache2. This flagged up that mysql-server-8.0 was not working correctly. So, I tried to repair mysql-server-8.0 but to no avail. The reinstallation kept telling me that the error logs were in /var/log/mysql/ but I cannot access this directory (mysql); permission denied (I have an admin user account and should have total control over the server). I have tried chown (with sudo) but still no luck.

The first error I spot with any of the alterations I have tried is:

2023-08-01T13:44:06.810792Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

If I run systemctl status mysql.services I get...

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (start) since Tue 2023-08-01 14:50:34 BST; 5s ago
    Process: 2814768 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 2814779 (mysqld)
     Status: "Server startup in progress"
      Tasks: 12 (limit: 9424)
     Memory: 278.0M
     CGroup: /system.slice/mysql.service
             └─2814779 /usr/sbin/mysqld

And if I do journalctl -xe then everything it reports seems fine (all relevant services queued have been started).

Continuing with the error list I have I get...

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2023-08-01 14:44:18 BST; 34ms ago
    Process: 2812282 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 2812304 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 2812304 (code=exited, status=1/FAILURE)
     Status: "Server shutdown complete"
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 it's a follow-up error from a previous failure.
                                                                                                            Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

So, it appears that I cannot run Apache2 because mysql is not running, which is not running because mysql-server-8 is not running; but I seem to be chasing my tail here.

Many of the advice steps I find are about flushing the database and I do NOT want to do that!

Any help please?

Luuk avatar
cn flag
I think you did forget the first step, which is "Make a backup, and check if the backup is OK"
Gazzieh avatar
it flag
Thank you so much for that comment; so helpful! To set the record straight, I was assured that backups were in place but then, once undertaken, the assurance was less forthcoming. I could spend far too much of my time trying to find out specifically whose fault it was and seek reprimand; or I could, instead, try to see if I can resolve the problem. I opt for 2.
Luuk avatar
cn flag
You do not need to reprimand anyone (except yourself). When you have a proper backup, you can revert to the original situation, en (try to) resolve the same problem again (and again)
Gazzieh avatar
it flag
You really have little idea. I am not in a position to run the backups myself. I enquired if backups were being taken. I was assured they were. They were not. Now, do you have any actual useful advice or do you wish to remain on that high and mighty platform offering unnecessary gems of 'wisdom' that simply show how little you know?
Luuk avatar
cn flag
This (stackoverflow) question/answer might help, you only need to change 5.7 to 8.0, and I cannot give any guarantees. [dpkg: error processing package mysql-server (dependency problems)?](https://stackoverflow.com/questions/43446218/dpkg-error-processing-package-mysql-server-dependency-problems). There is even an older q/a on askubuntu here: https://askubuntu.com/questions/789686/dpkg-error-processing-package-mysql-server-configure
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.