Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    156
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. psrsathish

    psrsathish Active Member

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

    Its not possible to repair all the databases in one time. You need to repair each and every database separately.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Nhojohl

    Nhojohl Well-Known Member

    Joined:
    Nov 28, 2006
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    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:
    166
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    168
    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:
    193
    Likes Received:
    1
    Trophy Points:
    168

    This worked great for me. Thanks for posting this!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice