Description:
mysql_upgrade does not support mysqld_multi environments. It ignores [mysqld_multi] and [mysqln]. To add insult to injury, mysql_upgrade no longer supports datadir options, so to upgrade, you have to do it manually, instance-by-instance, and create temporary my.cnf files for each instance, one at a time, to specify datadir. Further, since mysql_upgrade calls mysqlcheck and the mysql client, these temporary my.cnf files also need settings for [mysql_upgrade], [mysqlcheck] and [mysql] to specify socket and port for each, and datadir and user for mysql_upgrade.
How to repeat:
set up an environment with multiple mysql instances and mysqld_multi. Try to upgrade.
Suggested fix:
Update mysql_upgrade script to check for mysqld_multi and [mysqln] groups, and act accordingly.