I ran into an issue during the upgrade process. Specifically, this query was failing:
Code: Select all
ALTER TABLE poller_output_realtime DROP PRIMARY KEY, ADD PRIMARY KEY (local_data_id, rrd_name, time, poller_id)
Code: Select all
2019/07/18 21:44:04 - CMDPHP ERROR: A DB Exec Failed!, Error: Specified key was too long; max key length is 767 bytes
2019/07/18 21:44:04 - CMDPHP SQL Backtrace: (/install/background.php[52]:Installer::beginInstall(), /lib/installer.php[3200]:Installer->install(), /lib/installer.php[2723]:Installer->upgradeDatabase(), /lib/installer.php[3099]:upgrade_to_1_2_5(), /install/upgrades/1_2_5.php[59]:db_install_execute(), /install/functions.php[119]:db_execute_prepared())
Code: Select all
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
I was able to resolve it by setting these in the server.cnf:
Code: Select all
innodb_file_format=Barracuda
innodb_file_per_table=1
innodb_large_prefix=1
My feature request is: could the installer/upgrader detect when a database is using utf8mb4, but does not have innodb_large_prefix enabled to avoid the upgrade process failing as it did for me here?
I'm proficient in PHP, so I'm happy to have a shot at adding this detection to the codebase myself if someone is willing to roughly point me in the right direction.