Hi there, apologies if this has been covered elsewhere, I wasn't able to find a good match.
I upgraded from Ubuntu 18.04 to 20.04 today using the graphical upgrader process and when it got to the mythtv part it just hung. I looked in some logs and saw that it was failing to connect to mysql - no idea why. Reluctantly I killed the following process
/usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mythtv-backend.postinst configure 2:29.1+fixes.20180414.329c235-0ubuntu3
and the upgrade carried on to completion. Needless to say when I run myth-frontend now it fails to connect to the database. I try to start mysql (which isn't running) and I get:
systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.
Or
/etc/init.d/mysql start
Starting mysql (via systemctl): mysql.serviceFailed to start mysql.service: Unit mysql.service not found.
Looking in the 'Ubuntu Software' UI tool I see I have 'MySQL Experimental MySQL Community snap' v8.0.0-dmr installed but it clearly isn't working correctly.
I'm stuck. I don't want to just uninstall / reinstall MySQL in case it loses my mythtv (MythConverg?) database files which I was using before the upgrade.
Can anyone guide me on what I need to do please?
Thanks,
- Chris
After Ubuntu 20.04 upgrade mysql not working
Re: After Ubuntu 20.04 upgrade mysql not working
I've never had the DB removed when uninstalling MySQL/MariaDB. But always do backups 1st.
I'd start by looking in /var/log/mysql/error.log for clues. This *may* help: journalctl --boot=0 --unit mysql.service
but mine only tells me that the service starts or stops.
I'd start by looking in /var/log/mysql/error.log for clues. This *may* help: journalctl --boot=0 --unit mysql.service
but mine only tells me that the service starts or stops.
Re: After Ubuntu 20.04 upgrade mysql not working
Thanks bill6502! Unfortunately the command just replies 'No entries'.
I have done some more digging and experimenting (after backing up my /var/lib/mysql dir) and the consistent theme whenever I try to install or uninstall mysql is this:
mysqld is running as pid 5537
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found. <<<<< This always happens
I am only familiar with init scripts, not systemd stuff so this is new for me. I note there is an /etc/init.d/mysql script which when I run also says
sudo /etc/init.d/mysql status
Unit mysql.service could not be found.
So I go looking for this 'mysql.service' thing and I find:
% ls -l /etc/systemd/system/mysql*
lrwxrwxrwx 1 root root 35 Dec 14 12:36 /etc/systemd/system/mysqld.service -> /lib/systemd/system/mariadb.service
lrwxrwxrwx 1 root root 35 Dec 14 12:36 /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service
Which points to:
ls -l /lib/systemd/system/mariadb.service
ls: cannot access '/lib/systemd/system/mariadb.service': No such file or directory
From this I gather that there has been some switcheroo of mysql with mariadb (whatever that is) - so I try to install it - but the Ubuntu Software install GUI does not find it.
Any info / ideas gratefully received at this point!
Thanks,
Chris
I have done some more digging and experimenting (after backing up my /var/lib/mysql dir) and the consistent theme whenever I try to install or uninstall mysql is this:
mysqld is running as pid 5537
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found. <<<<< This always happens
I am only familiar with init scripts, not systemd stuff so this is new for me. I note there is an /etc/init.d/mysql script which when I run also says
sudo /etc/init.d/mysql status
Unit mysql.service could not be found.
So I go looking for this 'mysql.service' thing and I find:
% ls -l /etc/systemd/system/mysql*
lrwxrwxrwx 1 root root 35 Dec 14 12:36 /etc/systemd/system/mysqld.service -> /lib/systemd/system/mariadb.service
lrwxrwxrwx 1 root root 35 Dec 14 12:36 /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service
Which points to:
ls -l /lib/systemd/system/mariadb.service
ls: cannot access '/lib/systemd/system/mariadb.service': No such file or directory
From this I gather that there has been some switcheroo of mysql with mariadb (whatever that is) - so I try to install it - but the Ubuntu Software install GUI does not find it.
Any info / ideas gratefully received at this point!
Thanks,
Chris
Re: After Ubuntu 20.04 upgrade mysql not working
OK I guess I have solved this, but it isn't perfect. I installed mysql by following the tutorial on the mariadb site and got that sort of working (*see below). Once I realised that by default mysqld now listens only on 127.0.0.1 I adjusted my mythtv settings and got mythtv-backend to start - only to discover that my /var/lib/mysql files were too old for the current mysql version so I then had to figure out how to upgrade them (mysql_upgrade). Finally I got it all to work.
*Running 'sudo systemctl start mysql' does not work properly - it does not detach from the terminal, so the terminal is blocked for the duration of the process - which isn't that long as the OS appears to kill mysqld after 15 or so minutes. This also happens when I reboot - mysqld starts at boot and then is mysteriously shut down after a while. So I disabled it with 'systemctl disable mariadb.service' and fell back to /etc/init.d/mysql which works perfectly. No idea why systemctl is being a pain, but at least I can bypass it.
*Running 'sudo systemctl start mysql' does not work properly - it does not detach from the terminal, so the terminal is blocked for the duration of the process - which isn't that long as the OS appears to kill mysqld after 15 or so minutes. This also happens when I reboot - mysqld starts at boot and then is mysteriously shut down after a while. So I disabled it with 'systemctl disable mariadb.service' and fell back to /etc/init.d/mysql which works perfectly. No idea why systemctl is being a pain, but at least I can bypass it.