I recently upgraded from mysql-community 5.7.4
to 5.7.8
. All packages show the newer version is correctly installed. I reinitialized my database using mysqld --initialize
and corresponding steps. I then restored from a full dump using the standard method (ie, zcat dumpfile.gz | mysql
). The server started up fine; I was able to start slave
and catch up to the master, still running on 5.7.4
. Now the weirdness begins. The user tables don't match. Even if I stop slave
and restart my mysqld process, the following (and similar) commands do something strange:
create user 'test'@'%' identified by 'test334455' ;
It puts the hash into the "plugin" field of the user table:
mysql> select user,host,password,plugin,authentication_string from user where user='test';
+------+------+----------+-------------------------------------------+-----------------------+
| user | host | password | plugin | authentication_string |
+------+------+----------+-------------------------------------------+-----------------------+
| test | % | | *443C443E4789A416587C0A5892C7D345B73B9B3B | NULL |
+------+------+----------+-------------------------------------------+-----------------------+
To make sure this isn't some weird package-specific bug, I initialized a new database and with a separate mysqld process, verifies the command works as expected. Somehow restoring from a dump or connecting as a slave to an older version causes the problem.
However, existing user entries (ones restored from the dump) are correct and work just fine.
UPDATE: It appears the password
field was removed between 5.7.5 and 5.7.6, but the restore-from-dump (not replication!) recreated the column; but the current version's create user
commands still assume a particular order to the columns (** facepalm **).
So the Question now is: How do I safely update the master database on 5.7.4 to 5.7.8, preferably without dump/restore?
UPDATE: The Mysql documentation does indeed cover this particular quirk, more or less, on a page well-worth bookmarking (Because really, MySQL, you have no shame in making incompatible changes to sub-minor versions.) https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html
mysql
you'll probably run into problems.mysql_upgrade
.