Run optimize command for sql from ssh?

Discussion in 'Site & Server Administration' started by ASTRAPI, Feb 7, 2010.

  1. #1
    Hello

    How can i run the repir and then the optimize command for my sql database like i do from phpmyadmin?

    Thank you
     
    ASTRAPI, Feb 7, 2010 IP
  2. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mysqlcheck --repair --optimize databasename I usually like to pip --auto-repair on rather than repair.

    Hope this helps!
     
    SecureCP, Feb 8, 2010 IP
  3. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you mean to run it as one command:

    mysqlcheck --repair --optimize databasename

    or like this?

    mysqlcheck --optimize databasename

    or i can run both?
     
    ASTRAPI, Feb 8, 2010 IP
  4. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can run them both in one command. Just a tip though, run it in screen. Depending on the size of the db it can take some time.
     
    SecureCP, Feb 9, 2010 IP