<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 4:  Database Administration 241 mysql> TRUNCATE TABLE table_name; mysql> quit If your SQL version doesn't have TRUNCATE TABLE,  use DELETE FROM table_name in- stead. 3.  Copy the old data le back onto the newly created data le.  (Don't just move the old le back onto the new le; you want to retain a copy in case something goes wrong.) Go  back  to  Stage  2.   myisamchk -r -q  should  work  now.   (This  shouldn't  be  an  endless loop.) As of MySQL 4.0.2 you can also use REPAIR ... USE_FRM which performs the whole procedure automatically. Stage 4:  Very dicult repair You should reach this stage only if the description le has also crashed.  That should never happen, because the description le isn't changed after the table is created: 1.  Restore  the  description   le  from  a  backup  and  go  back  to  Stage  3.   You  can  also restore the index le and go back to Stage 2.  In the latter case, you should start with myisamchk -r. 2.  If you don't have a backup but know exactly how the table was created, create a copy of the table in another database.  Remove the new data le, then move the description and index les from the other database to your crashed database.  This gives you new description  and  index   les,  but  leaves  the  data le  alone.   Go  back  to  Stage  2  and attempt to reconstruct the index le. 4.4.6.10  Table Optimisation To coalesce fragmented records and eliminate wasted space resulting from deleting or up- dating records, run myisamchk in recovery mode: shell> myisamchk -r tbl_name You  can  optimise  a  table  in  the  same  way  using  the  SQL  OPTIMIZE TABLE  statement. OPTIMIZE TABLE  does  a  repair  of  the  table  and  a  key  analysis,  and  also  sorts  the  index tree to give faster key lookups.  There is also no possibility of unwanted interaction between a utility and the server, because the server does all the work when you use OPTIMIZE TABLE. See Section 4.5.1 [OPTIMIZE TABLE], page 247. myisamchk also has a number of other options you can use to improve the performance of a table: -S, --sort-index -R index_num, --sort-records=index_num -a, --analyze For a full description of the option.  See Section 4.4.6.1 [myisamchk syntax], page 232.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide