À chaque fois qu'un compte utilisateur est ajouté dans MariaDB avec XAMPP via phpMyAdmin, la base de données se plante au cours des 5 prochains redémarrages même en anticipant les opérations qui suivent. Ce bug non corrigé depuis des mois est très pénible, récurrent, usant, fatiguant, à vomir. Il se corrige comme suit.
[ERROR] mysqld: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
[ERROR] mysqld: Index for table '.\mysql\db' is corrupt; try to repair it [ERROR] Couldn't repair table: mysql.db [ERROR] Fatal error: Can't open and lock privilege tables: Index for table 'db' is corrupt; try to repair it
Comme révélé à ce lien, il faut faire une opération de maintenance.
(Étape facultative à reconfirmer) Éditez tout d'abord le fichier mysql_start.bat de XAMPP afin d'ajouter le paramètre «--skip-grant-tables» sur la ligne contenant «mysqld». Double-cliquez le fichier BAT : MariaDB se lance correctement (ou pas) puisque le problème réside dans la table des utilisateurs qui n'est désormais plus chargée.
Lancez ensuite la commande suivante dans une console à partir du dossier xampp/mysql/bin. Cette opération permet de vérifier et de réparer les tables selon la même technique que nous avions vu lors de la migration.
mysqlcheck -r --databases mysql --use-frm
mysql.column_stats OK mysql.columns_priv OK mysql.db warning : Number of rows changed from 0 to 5 status : OK mysql.event OK mysql.func OK mysql.global_priv warning : Number of rows changed from 0 to 8 status : OK mysql.gtid_slave_pos note : The storage engine for the table doesn't support repair mysql.help_category warning : Number of rows changed from 0 to 48 status : OK mysql.help_keyword warning : Number of rows changed from 0 to 37 status : OK mysql.help_relation warning : Number of rows changed from 0 to 114 status : OK mysql.help_topic warning : Number of rows changed from 0 to 752 status : OK mysql.index_stats OK mysql.innodb_index_stats note : The storage engine for the table doesn't support repair mysql.innodb_table_stats note : The storage engine for the table doesn't support repair mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv warning : Number of rows changed from 0 to 1 status : OK mysql.roles_mapping OK mysql.servers OK mysql.table_stats OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.transaction_registry note : The storage engine for the table doesn't support repair
Stoppez MariaDB, retirez le paramètre de la ligne de commande et MariaDB peut désormais se relancer sans perte de vos données.