The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Repair all database in mysql

Discussion in 'General Discussion' started by robocap, Jul 29, 2007.

  1. robocap

    robocap Well-Known Member

    Joined:
    Nov 6, 2006
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Hello
    we have whm in my server
    in whm is one part to name
    Repair Mysql Database


    this is only for one database
    how may i repaired all database in my server?

    Thanks
     
  2. psrsathish

    psrsathish Active Member

    Joined:
    Jul 19, 2006
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India.
    Hi,

    Its not possible to repair all the databases in one time. You need to repair each and every database separately.
     
  3. Nhojohl

    Nhojohl Well-Known Member

    Joined:
    Nov 28, 2006
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    mysqlcheck -Aao --auto-repair -u root --password="ROOTPASS"

    use the quotes also :P
     
  4. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    The database server needs to be running to do any of these checks. Log in as 'root' via SSH and:

    Shows you if any need repair:
    myisamchk --check /var/lib/mysql/*/*.MYI

    Then try 'safe-recover' first:
    myisamchk --safe-recover /var/lib/mysql/*/*.MYI

    and, if neither that nor this works:
    myisamchk --recover /var/lib/mysql/*/*.MYI

    Then use the 'force' flag:
    myisamchk --safe-recover --extend-check --force /var/lib/mysql/*/*.MYI

    or:
    myisamchk --recover --extend-check --force /var/lib/mysql/*/*.MYI
     
  5. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    mysqlcheck --all-databases -r #repair
    mysqlcheck --all-databases -a #analyze
    mysqlcheck --all-databases -o #optimize
     
    sardelich likes this.
  6. Fernis

    Fernis Well-Known Member

    Joined:
    Oct 28, 2006
    Messages:
    192
    Likes Received:
    1
    Trophy Points:
    18

    This worked great for me. Thanks for posting this!
     
Loading...

Share This Page