Geen cache-versie.


Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code DEF204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher dans le manuel MySQL

16.4.1 Repairing and Checking CSV Tables

The CSV storage engine supports the CHECK TABLE and REPAIR TABLE statements to verify and, if possible, repair a damaged CSV table.

When running the CHECK TABLE statement, the CSV file will be checked for validity by looking for the correct field separators, escaped fields (matching or missing quotation marks), the correct number of fields compared to the table definition and the existence of a corresponding CSV metafile. The first invalid row discovered will report an error. Checking a valid table produces output like that shown below:

  1. mysql> CHECK TABLE csvtest;
  2. +--------------+-------+----------+----------+
  3. | Table        | Op    | Msg_type | Msg_text |
  4. +--------------+-------+----------+----------+
  5. | test.csvtest | check | status   | OK       |
  6. +--------------+-------+----------+----------+

A check on a corrupted table returns a fault:

  1. mysql> CHECK TABLE csvtest;
  2. +--------------+-------+----------+----------+
  3. | Table        | Op    | Msg_type | Msg_text |
  4. +--------------+-------+----------+----------+
  5. | test.csvtest | check | error    | Corrupt  |
  6. +--------------+-------+----------+----------+

If the check fails, the table is marked as crashed (corrupt). Once a table has been marked as corrupt, it is automatically repaired when you next run CHECK TABLE or execute a SELECT statement. The corresponding corrupt status and new status will be displayed when running CHECK TABLE:

  1. mysql> CHECK TABLE csvtest;
  2. +--------------+-------+----------+----------------------------+
  3. | Table        | Op    | Msg_type | Msg_text                   |
  4. +--------------+-------+----------+----------------------------+
  5. | test.csvtest | check | warning  | Table is marked as crashed |
  6. | test.csvtest | check | status   | OK                         |
  7. +--------------+-------+----------+----------------------------+

To repair a table, use REPAIR TABLE, which copies as many valid rows from the existing CSV data as possible, and then replaces the existing CSV file with the recovered rows. Any rows beyond the corrupted data are lost.

  1. mysql> REPAIR TABLE csvtest;
  2. +--------------+--------+----------+----------+
  3. | Table        | Op     | Msg_type | Msg_text |
  4. +--------------+--------+----------+----------+
  5. | test.csvtest | repair | status   | OK       |
  6. +--------------+--------+----------+----------+
Warning

During repair, only the rows from the CSV file up to the first damaged row are copied to the new table. All other rows from the first damaged row to the end of the table are removed, even valid rows.


Zoek in de MySQL-handleiding

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-se-csv-repair.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:en Manuel MySQL : https://dev.mysql.com/

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut