diff --git a/HowtoMySQL/Troubleshooting.md b/HowtoMySQL/Troubleshooting.md index 46fd9c4a..fd617a6a 100644 --- a/HowtoMySQL/Troubleshooting.md +++ b/HowtoMySQL/Troubleshooting.md @@ -772,4 +772,23 @@ mysql> SHOW GLOBAL VARIABLES LIKE '%recover_options%'; ~~~ Cela signifie que lorsqu'une table est réparé, si le résultat diffère, MySQL fait une backup. -Plus d'informations sur la [documentation](https://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_myisam-recover-options). \ No newline at end of file +Plus d'informations sur la [documentation](https://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_myisam-recover-options). + +## Erreur 1217 + +~~~ +MariaDB [(none)]> drop database `db_name`; +ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails +~~~ + +Pour contourner ce problème on peut faire : + +~~~ +MariaDB [(none)]> SET FOREIGN_KEY_CHECKS=0; +Query OK, 0 rows affected (0.00 sec) +MariaDB [(none)]> drop database `db_name`; +Query OK, 1 row affected (0.00 sec) + +MariaDB [(none)]> SET FOREIGN_KEY_CHECKS=1; +Query OK, 0 rows affected (0.00 sec) +~~~ \ No newline at end of file