Mariadb-docker: Run `mysql_upgrade` / `mariadb-upgrade` at startup

Created on 24 Feb 2021  路  6Comments  路  Source: MariaDB/mariadb-docker

I was looking into upgrading my instance of MariaDB from 10.4 to 10.5, and according to https://mariadb.com/kb/en/upgrading-from-mariadb-104-to-mariadb-105/, I'm supposed to run mysql_upgrade or mariadb-upgrade as part of the upgrade procedure.

I didn't see this being done anywhere in docker-entrypoint.sh, so I ran it myself after restarting with the mariadb:10.5 image. According to the mysql_upgrade docs:

It's also safe to run mysql_upgrade for minor upgrades, as if there are no incompatibles [sic] between versions it changes nothing.

So it seems like it might be a good idea to just always run it as part of startup to make version upgrades more seamless.

Request

Most helpful comment

I'm not totally sure this is -- I think this is somewhere we could use a little guidance from @grooverdan on whether this is something recent versions of MariaDB do automatically like MySQL 8+ has started doing? :innocent: :pray:

All 6 comments

I'm not totally sure this is -- I think this is somewhere we could use a little guidance from @grooverdan on whether this is something recent versions of MariaDB do automatically like MySQL 8+ has started doing? :innocent: :pray:

Yep, I agree. Its a good thing to do. Even on minor upgrade there are things it corrects (JSON plugins from 5.7 data directories, mysql.user correctness to name two things I recently remember).

I think the most difficult problem is detection of _when_ it ought to be run because it requires the server to be up before it can run (so it requires the same temporary server logic as the initial bootstrapping), so it isn't reasonable to just run it every time (unless MariaDB's version has an offline mode? :innocent:)

Created https://jira.mariadb.org/browse/MDEV-25670 , might be possible without mysql_upgrade changes.

@timofeyturenko can you please have a look?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amon-ra picture amon-ra  路  3Comments

citiscaner picture citiscaner  路  3Comments

iBobik picture iBobik  路  7Comments

J0WI picture J0WI  路  5Comments

andrerom picture andrerom  路  5Comments