Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
linux:mysql [28-04-2021 08:47] – [InnoDB] edmc73 | linux:mysql [14-02-2023 10:39] (Version actuelle) – [Sauvegarder] edmc73 | ||
---|---|---|---|
Ligne 64: | Ligne 64: | ||
* --lock-tables=false : option stops MyISAM tables (if they exsit) being locked during the backup | * --lock-tables=false : option stops MyISAM tables (if they exsit) being locked during the backup | ||
- | Restaurer | + | |
+ | Sauvegarder une table avec des conditions WHERE | ||
+ | |||
+ | <code bash> | ||
+ | # Dump only the rows with the id column bigger than 500 | ||
+ | mysqldump my_db_name my_table_name --where=" | ||
+ | |||
+ | # Dump only the rows with the created_at column in the given interval | ||
+ | mysqldump my_db_name my_table_name --where=" | ||
+ | </ | ||
+ | ==== Restaurer | ||
mysql -u user -p nom_de_la_base < backup.sql | mysql -u user -p nom_de_la_base < backup.sql | ||