Escenario
Después de necesitar restaurar tres veces el servidor de MySql por culpa de varios crashs provocados por un fallo en el disco duro, encuentro en los logs entradas de este tipo: 2020-09-12T18:46:22.347957Z 5 [Warning] InnoDB: Cannot open table mysql/help_relation from the internal data2020-09-12T18:46:22.348985Z 5 [Warning] InnoDB: Cannot open table mysql/innodb_index_stats from the internal data dictionary of InnoDBdictionaryProblema
En varios foros leo que la solución pasa por hacer un:
1 |
$ sudo mysql_upgrade -root -p |
Solución
Antes de lanzar el comando de mysql_upgrade, he seguido estos pasos:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
sudo -i service mysql stop cd /var/lib/mysql/mysql mkdir temp mv engine_cost.* temp/ mv gtid_executed.* temp/ mv help_category.* temp/ mv help_keyword.* temp/ mv help_relation.* temp/ mv help_topic.* temp/ mv innodb_index_stats.* temp/ mv innodb_table_stats.* temp/ mv plugin.* temp/ mv server_cost.* temp/ mv servers.* temp/ mv slave_master_info.* temp/ mv slave_relay_log_info.* temp/ mv slave_worker_info.* temp/ mv time_zone.* temp/ mv time_zone_leap_second.* temp/ mv time_zone_name.* temp/ mv time_zone_transition.* temp/ mv time_zone_transition_type.* temp/ service mysql start mysql_upgrade -uroot -p --upgrade-system-tables |