myisampack is a tool for compressing MyISAM tables. The resulting tables
are read-only, and usually about 40% to 70% smaller. It is run as follows:
The file_name is the .MYI index file. The extension can be omitted,
although keeping it permits wildcards, such as:
...to compress all the files.
myisampack compresses each column separately, and, when the resulting data
is read, only the individual rows and columns required need to be decompressed,
allowing for quicker reading.
Once a table has been packed, use (the quick and recover options) to rebuild its indexes.
myisampack does not support partitioned tables or vector indexes.
Do not run myisampack if the tables could be updated during the operation, and has been set.
The following variables can be set while passed as command line options tomyisampack, or set with a [myisampack] section in your file.
To uncompress a table compressed with myisampack, use the option.
This page is licensed: CC BY-SA / Gnu FDL
myisampack [options] file_name [file_name2...]myisampack *.MYI-?, --help
Display help and exit.
-s, --silent
Only write output when an error occurs
-T, --tmpdir=name
Use temporary directory to store temporary table.
-t, --test
Don't pack table, only test packing it.
-v, --verbose
Write info about progress and packing result. Use multiple -v flags for more verbosity.
-V, --version
Output version information and exit.
-w, --wait
Wait and retry if table is in use.
-b, --backup
Make a backup of the table as table_name.OLD.
--character-sets-dir=name
Directory where character sets are.
-
## , --debug[=name]
Output debug log. Often this is 'd:t:o,filename'.
-f, --force
Force packing of table even if it gets bigger or if tempfile exists.
-j, --join=name
Join all given tables into 'new_table_name'. All tables must have identical layouts.
> myisampack /var/lib/mysql/test/posts
Compressing /var/lib/mysql/test/posts.MYD: (1680 records)
- Calculating statistics
- Compressing file
37.71%
> myisamchk -rq /var/lib/mysql/test/posts
- check record delete-chain
- recovering (with sort) MyISAM-table '/var/lib/mysql/test/posts'
Data records: 1680
- Fixing index 1
- Fixing index 2