MySQL – Running mysql_upgrade on Fresh MySQL/MariaDB Installation

mariadbMySQLupgrade

What I've noticed lately is that whenever I install MariaDB or MySQL on a clean machine, and if I run mysql_upgrade it does the upgrading, so I figured since it's not showing it's already upgraded, I should do it.
So, it's been my practice ever since. Does anyone know anything more about this? Why this isn't done during installation process? Does this mean newer mariadb/MySQL server comes with table from older version?

Best Answer

According to Bogdan Kecman who worked at Oracle:

mysql_upgrade checks whether the tables are at the latest version, if not - upgrades them and then marks them as upgraded. On a fresh install, even though tables are on the latest version, they are not marked. So, mysql_upgrade marks them. It does nothing else. To avoid scanning them again when mysql_upgrade runs.

Sorry for lousy translation.