The answer was here: https://www.mediawiki.org/wiki/Manual:$wgDBmwschema
My LocalSettings.php began life a good while ago, and indeed, it had $wgDBmwschema set to 'mediawiki'.
I commented this out, and now update.php can run.
update.php gets pretty far, but not all the way through. Here's the last thing it did:
Running maintenance/deduplicateArchiveRevId.php... Deduplicating ar_rev_id... Row 940 conflicts with revision row for rev_id 1833, reassigning Row 941 conflicts with revision row for rev_id 1834, reassigning Row 982 conflicts with revision row for rev_id 1868, reassigning Row 1067 conflicts with revision row for rev_id 1992, reassigning Row 1068 conflicts with revision row for rev_id 1993, reassigning Row 1076 conflicts with archive row 1069 for rev_id 1994, reassigning Row 1077 conflicts with archive row 1073 for rev_id 1995, reassigning Row 1078 conflicts with archive row 1072 for rev_id 1996, reassigning Row 1079 conflicts with archive row 1071 for rev_id 1997, reassigning Row 1080 conflicts with archive row 1074 for rev_id 1998, reassigning Row 1081 conflicts with archive row 1070 for rev_id 1999, reassigning [3f3634afa8a03289878f8ff9] [no req] Wikimedia\Rdbms\DBQueryError from line 1496 of /usr/local/www/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: UPDATE `mw_archive` SET ar_rev_id = '3867' WHERE ar_id = '940' Function: PopulateArchiveRevId::reassignArRevIds Error: 1785 Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables. (localhost)
Backtrace: #0 /usr/local/www/mediawiki/includes/libs/rdbms/database/Database.php(1466): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string) #1 /usr/local/www/mediawiki/includes/libs/rdbms/database/Database.php(1226): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean) #2 /usr/local/www/mediawiki/includes/libs/rdbms/database/Database.php(2112): Wikimedia\Rdbms\Database->query(string, string) #3 /usr/local/www/mediawiki/maintenance/populateArchiveRevId.php(179): Wikimedia\Rdbms\Database->update(string, array, array, string) #4 /usr/local/www/mediawiki/maintenance/deduplicateArchiveRevId.php(187): PopulateArchiveRevId::reassignArRevIds(Wikimedia\Rdbms\DatabaseMysqli, array) #5 /usr/local/www/mediawiki/maintenance/deduplicateArchiveRevId.php(93): DeduplicateArchiveRevId->processArRevIds(Wikimedia\Rdbms\DatabaseMysqli, array, array) #6 /usr/local/www/mediawiki/maintenance/Maintenance.php(1698): DeduplicateArchiveRevId->doDBUpdates() #7 /usr/local/www/mediawiki/includes/installer/DatabaseUpdater.php(1031): LoggedUpdateMaintenance->execute() #8 /usr/local/www/mediawiki/includes/installer/DatabaseUpdater.php(485): DatabaseUpdater->runMaintenance(string, string) #9 /usr/local/www/mediawiki/includes/installer/DatabaseUpdater.php(449): DatabaseUpdater->runUpdates(array, boolean) #10 /usr/local/www/mediawiki/maintenance/update.php(203): DatabaseUpdater->doUpdates(array) #11 /usr/local/www/mediawiki/maintenance/doMaintenance.php(94): UpdateMediaWiki->execute() #12 /usr/local/www/mediawiki/maintenance/update.php(248): require_once(string) #13 {main}
I did indeed run mysql_upgrade, so I'm not sure what to do now. Running mysql_upgrade again just says that it is already upgraded.
Suggestions?