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?
1 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 whenmysql_upgrade
runs.
Sorry for lousy translation.
mysql_upgrade also saves the MySQL version number in a file named mysql_upgrade_info in the data directory. This is used to quickly check whether all tables have been checked for this release so that table-checking can be skipped.
this file is not present during initial installation hence when you run mysql_upgrade it will not tell you that there is no need for it on a fresh install