Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

For various reasons I had to update my OS. Was on Xubuntu 19.04, updated to 20.04. (19.04 was too old and even had to point to old-releases.ubuntu.com to get anywhere.)

Afterward, mythtv isn't starting correctly. Mysql isn't starting either. I'm thinking the update replaced mysql with mariadb.

I tried

sudo systemctl restart mysql.service

and the output said it timed out. Took about 5 minutes. Also, the output mentioned mariadb. Pretty sure before this I was on mysql because I had checked the welcome message.

I don't care whether it's mysql or mariadb as I know they are supposed to be interchangeable, I just need to get it working before I lose upcoming recordings. Anybody run into this? Any threads showing how to fix it? Sorry if I've missed any in my hurried search.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

After rebooting, I see MariaDB is running. (Checked the welcome message. Not MySQL anymore) But mythbackend is not running. If I run

sudo systemctl restart mythtv-backend.service

It starts the backend (after about 5 minutes) but has "broken" MariaDB (can't connect.)

So I reboot again, and this time instead of using systemctl I just run mythbackend directly. It's running, I can run frontend too, seems normal so far.

But it's not going to auto-start in this state, so I'll leave it locked to record stuff overnight.

BTW mythshutdown -C shows it's locked, but also has a Segmentation fault. Ugh.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

Ugh. The database dies after a while. Guess I'll be missing some recordings.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by bill6502 »

Any clues in /var/log/mysql/error.log?

You may be able to verify your previous SQL server with: journalctl --boot=1 --unit=mariadb --unit=mysql --unit=mysqld
(at least that will get the version after the earliest boot in the journal.)

I upgraded Ubuntu 19.10 to 20.04 and my server was MariaDB and remained so. A clean install of
Ubuntu 20.04 installed MySQL v8.0.

The SEGV will likely happen on mythEveryProgramName. It's a known bug, and upstream doesn't
seem likely to fix it.This has detail: https://lists.gt.net/mythtv/users/632248 . It appears to be harmless,
but anoying.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

I will check that tomorrow. Giving up for the night before I make more of a mess.

One question: Anybody familiar with Timeshift? Can it restore a snapshot from an earlier version of the OS? I have a snapshot from today, just before I started upgrading. What happens to files in use?
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

Timeshift restore worked. I'm back on Xubuntu 19.03 / MythTV 30.

I watched a few videos on Timeshift restores, and saw that once you start the restore, it drops to a console, then automatically reboots when finished. That wasn't clear from documentation/descriptions I'd seen, so I was worried the restore would stop and break with "file access errors" or similar. But it worked.

So now I want to update the OS to 20.04 and MythTV to 31. I'm guessing I should start with MythTV because I noticed updating OS to 20.04 deleted Python 2, but also MythTV! There was a huge list of stuff it was going to uninstall. I paged through it a bit but gave up and continued.

BTW, Timeshift by default doesn't backup home directories. I had added all home directories before I backed up as there are settings etc. for MythTV there. I also excluded my recording directories. As nothing was recorded or deleted between backup and restore, everything still seems to sync up.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

Current state:

I upgraded MythTV to 31. Checked everything out, works, made a backup.

Ran another update, let it update everything for 19.04. Checked it out and made a backup.

Next problem:

To upgrade OS to 20.04, I have to upgrade to 19.10 first, right?

When I begin the upgrade to 19.10 and look at details before actually starting it, it shows that it is going to install mariadb 10.3 and uninstall mysql 5.7.

I don't want to do that. It's what caused the problems last night where mythbackend wouldn't start automatically. Even when I started it manually, I found things would work for a while and then the db would crash.

Is there any way to retain mysql when upgrading OS?
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by bill6502 »

Let me look into this. In the MythTV packaging repo, I see this line:

Code: Select all

control:Depends: default-mysql-server | virtual-mysql-server | mysql-server-5.7 | mysql-server-5.6 | mariadb-server,
I'm thinking this was never updated and should contain mysql-server-8.0, or just mysql-server
which should pull in the latest version of the server. What I'm missing is that when I did the
clean load of MythTV, 8.0 was used. So, maybe the default-mysql-server is why it worked.
But that doesn't explain your case.

What does the output of: dpkg -l mariadb-server mysql-server look like on your host.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

I can run dpkg tomorrow if you need the output. But I know it's mysql 5.7, and no mariadb.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

Code: Select all

sudo dpkg -l *mysql-server* *mariadb-server*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                      Version                 Architecture Description
+++-=========================-=======================-============-====================================================================
ii  default-mysql-server      1.0.5                   all          MySQL database server binaries and system database setup (metapackag
un  mariadb-server            <none>                  <none>       (no description available)
un  mariadb-server-10.3       <none>                  amd64        (no description available)
un  mariadb-server-5.5        <none>                  <none>       (no description available)
un  mysql-server              <none>                  <none>       (no description available)
un  mysql-server-5.5          <none>                  <none>       (no description available)
un  mysql-server-5.6          <none>                  <none>       (no description available)
hi  mysql-server-5.7          5.7.28-0ubuntu0.19.04.2 amd64        MySQL database server binaries and system database setup
un  mysql-server-core-5.5     <none>                  <none>       (no description available)
un  mysql-server-core-5.6     <none>                  <none>       (no description available)
ii  mysql-server-core-5.7     5.7.28-0ubuntu0.19.04.2 amd64        MySQL database server binaries
un  virtual-mysql-server      <none>                  <none>       (no description available)
un  virtual-mysql-server-core <none>                  <none>       (no description available)
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by bill6502 »

Thanks for that. I've got a patch that adds mysql-server-8.0 to the list, but
before doing that:

I see the hold on mysql-server-5.7. I don't have a 19.xx anymore, but in 20.04:

Code: Select all

apt show mythtv
... Depends: default-mysql-server ...
apt show default-mysql-server
... Depends: mysql-server-8.0 ...
Can you try again after doing: sudo apt-mark unhold mysql-server-5.7
looking at details before actually starting it.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

Oh! I forgot I had added a hold on mysql 5.7 before I ran that. (Added after the problems described earlier.) I've since removed the hold, and it shows ii instead of hi...

Code: Select all

sudo dpkg -l *mysql-server* *mariadb-server*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                      Version                 Architecture Description
+++-=========================-=======================-============-====================================================================
ii  default-mysql-server      1.0.5                   all          MySQL database server binaries and system database setup (metapackag
un  mariadb-server            <none>                  <none>       (no description available)
un  mariadb-server-5.5        <none>                  <none>       (no description available)
un  mysql-server              <none>                  <none>       (no description available)
un  mysql-server-5.5          <none>                  <none>       (no description available)
un  mysql-server-5.6          <none>                  <none>       (no description available)
ii  mysql-server-5.7          5.7.28-0ubuntu0.19.04.2 amd64        MySQL database server binaries and system database setup
un  mysql-server-core-5.5     <none>                  <none>       (no description available)
un  mysql-server-core-5.6     <none>                  <none>       (no description available)
ii  mysql-server-core-5.7     5.7.28-0ubuntu0.19.04.2 amd64        MySQL database server binaries
un  virtual-mysql-server      <none>                  <none>       (no description available)
un  virtual-mysql-server-core <none>                  <none>       (no description available)
And, apt show default-mysql-server shows "Depends: mysql-server-5.7"
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by bill6502 »

Actually I was suggesting trying to go to 20.04 again and see if it still
wants to install MariaDB. My thinking is that the held mysql-server-5.7
isn't available in 20.04 and mariadb-server was the only other choice.

Code: Select all

apt show mysql-server-5.7 # Run on a 20.04 host
Package: mysql-server-5.7
State: not a real package (virtual)
N: Can't select candidate version from package mysql-server-5.7 as it has no candidate
N: Can't select versions from package 'mysql-server-5.7' as it is purely virtual
N: No packages found
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

I wasn't holding any package when I tried upgrading, any time. I only held that yesterday but never tried upgrading while it was held.

I have to upgrade to 19.10 first, before 20.04. And when I start upgrading to 19.10 and look at details before clicking start, it wants to uninstall mysql 5.7 and install mariadb 10.3. The reason I held mysql 5.7 was to see if I could run the upgrade and force it to keep mysql 5.7, then update it afterward, but I didn't get far enough to know if that would work.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Help, Mysql (MariaDB?) not starting after upgrading Xubuntu to 20.04

Post by wmorrison »

So the reason I had held the mysql package was to see if that would prevent the upgrade from 19.4 to 19.10 from replacing mysql with mariadb. But we wanted to watch something before I could run the upgrade and I forgot it was held when I initially ran dpkg to get the output.

So now I've just upgraded to 19.10 while the mysql packages were held. It left mysql 5.7 alone. Everything works (mythtv related anyway.)

Next step unholding packages and seeing if I can upgrade to mysql 8. But time for a break now. :)
Post Reply