#841345 mysql-server-5.7: Unable to switch from mariadb to mysql, "downgrade" is aborted

#841345#5
Date:
2016-10-19 16:49:54 UTC
From:
To:
Switching from mariadb to mysql fails with the following error message:

Aborting downgrade from (at least) 10.0 to 5.7.
If are sure you want to downgrade to 5.7, remove the file
/var/lib/mysql/debian-*.flag and try installing again.


The test[1] seems to be a bit naive, given that mariadb uses the same
flag file.

Mariadb and mysql are supposed to be drop-in replacements, so switching
between them should be supported.


[1] https://sources.debian.net/src/mysql-5.7/5.7.15-1/debian/mysql-server-5.7.preinst/#L81-L87

#841345#10
Date:
2016-10-19 17:31:47 UTC
From:
To:
Hi,

thanks for your bug report.
when it comes to switching between mysql and mariadb versions this might
get tricky as we have to define which versions can be switched and which
not.
To be honest I have no clue which mariadb version could be replaced by
mysql and vica versa.
Maybe some team members (Otto?) may have more insight?

Cheers
B

#841345#15
Date:
2016-10-19 18:46:11 UTC
From:
To:
Oh, bummer.


Then mysql and mariadb should not share the /var/lib/mysql directory,
and instead there should be a command to offer trying to "seed" the db
using the other database's files.

#841345#20
Date:
2016-10-19 18:47:30 UTC
From:
To:
This is incorrect. They aren't drop-in replacements. MariaDB changes the
internal database format in ways that MySQL doesn't understand. There is
no automated way to switch back.

I'll leave this bug open because I think the UX could be better, but
they need pretty extensive refactoring of how MySQL and MariaDB packages
interact. I'd like for it to be possible for the user to end up with the
option of having a blank database when switch back to MySQL with the
MariaDB database retained, for example. However, I don't think it'll
ever be possible to switch back automatically, as this is simply not
supported by the upstreams.

This is also tracked downstream in Ubuntu at
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071.

#841345#25
Date:
2016-10-19 17:08:43 UTC
From:
To:
----- fsateler@debian.org wrote:
This is a misunderstanding, unfortunately. MySQL and MariaDB are not drop-in replacements of each other.
MariaDB is able to read the databases of some MySQL versions (5.5 and earlier and probably 5.6, since the database structure didn't change too much there), but as far as I know they don't yet support 5.7-created databases in any released version.
MySQL does not support running with a MariaDB-created database.

While the flag system does need a redesign (there's an issue to track this at https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071) it's more likely the solution there will be to move the old versions data "out of the way", possibly with an option to try using it.

#841345#30
Date:
2016-10-19 19:08:37 UTC
From:
To:
I agree. This is my proposed solution to the problem (but I still need
to write the code so that it can be discussed).

#841345#35
Date:
2016-10-19 18:56:14 UTC
From:
To:
----- fsateler@debian.org wrote:
Yes, separating the actual files of the two seems a better long-term solution to me (and the packaging for both could check for the presence of the others and ask users if an attempt to import should be made).

But while this isn't a huge task for MySQL and MariaDB, I know there are other packages that use them with hard-coded paths, and they will start breaking. I'd say this is to be considered a bug in those packages, but it does mean it's not a small task.

#841345#40
Date:
2021-02-13 13:54:23 UTC
From:
To:
Dear submitter,

as the package mysql-5.7 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/969095

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Joerg Jaspert (the ftpmaster behind the curtain)