MyISAM tables are used by default with MySQL. (Web design tools)
Wednesday, November 21st, 2007MyISAM tables are used by default with MySQL. The tables are stored in the /var/lib/mysql/dbname directory by default, where dbname is replaced by the name of the database you are using. For each table, there are three files in this directory. Each file begins with the table name and ends with one of the following three suffixes: .frm Contains the definition (or form) or the table .MYI Contains the table’s index. .MYD Contains the table’s data. The following procedure describes how to use the myisamchk command to check your MyISAM tables. (The procedure is the same for checking ISAM tables, except that you use the isamchk command instead.) Note Do a backup of your database tables before running a repair with myisamchk. Though myisamchk is unlikely to damage your data, backups are still a good precaution. 1. Stop your MySQL server temporarily by typing the following from a Terminal window as the root user: # /etc/init.d/mysqld stop 2. You can check all or some of your database tables at once. The first example shows how to check a table called “names” in the “allusers” database. # myisamchk /var/lib/mysql/allusers/names.MYI Checking MyISAM file: /var/lib/mysql/allusers/names.MYI Data records: 5 Deleted blocks: 0 - check file-size - check key delete-chain - check record delete-chain - check index reference - check record links You could also check tables for all your databases at once as follows: # myisamchk /var/lib/mysql/*/*.MYI The example above shows a simple, 5-record database where no errors were encountered. If instead of the output shown above, you see output like the following you may need to repair the database: Checking MyISAM file: names.MYI Data records: 5 Deleted blocks: 0 - check file-size myisamchk: warning: Size of datafile is: 689 Should be: 204 - check key delete-chain - check record delete-chain - check index reference - check record links myisamchk: error: Found wrong record at 0 MyISAM-table ‘names.MYI’ is corrupted Fix it using switch “-r” or “-o” 3. To fix a corrupted database, you could run the following command # myisamchk -r /var/lib/allusers/names.MYI - recovering (with keycache) MyISAM-table ‘names.MYI’ Data records: 5
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.