Recovery Options for MyISAM (MySQL / MariaDB)

Published: 10 September 2023
on channel: Database Dive
45
1

In this SQL tutorial we'll walk you through the "myisam_recover_options" SQL variable.
This SQL variable impacts how the MariaDB Server and MySQL Server engine MyISAM recovers data.
This SQL variable has a couple of options:
1) DEFAULT - this value is the default value for MariaDB up to 10.2.3. When this SQL variable is in use, data recovery is performed without backing up SQL data or checking for any errors.
2) BACKUP - MyISAM will backup the data files relevant to tables (.MYD) if there are any changes to data during the recovery process.
3) BACKUP_ALL - the MySQL Server running MyISAM will also back up SQL index files within the database tables (SQL indexes are represented as .MYI files.)
4) FORCE - forces data recovery even if errors are encountered on the way. Data can be lost.
5) QUICK - forces a quick data recovery, but does not check for data integrity or anything like that. Speed of the SQL query is the priority.
6) OFF or " " - data recovery for MyISAM tables is off. If data recovery is disabled, MyISAM won't attempt to repair any tables.

This SQL variable also accepts multiple values to be used at once. For example, "BACKUP,QUICK" ("BACKUP" and "QUICK") is the default value for present versions of MariaDB Server.

Did this SQL tutorial prepare you for your next SQL interview? Tell us in the comments below.

Music:
Buddy by Roa   / roa_music1031  
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: https://bit.ly/3Wvb1uW
Music promoted by Audio Library: https://bit.ly/485KFFx

#database #sql #developer #web #reels #shorts #mysql #interview