Skip to content

Instantly share code, notes, and snippets.

@gearoidc
Created November 22, 2013 14:54
Show Gist options
  • Save gearoidc/7601149 to your computer and use it in GitHub Desktop.
Save gearoidc/7601149 to your computer and use it in GitHub Desktop.
mysql client command to optimize tables
$ mysql -u <username> -p -Bse 'show tables' <dbname> | xargs | perl -pe 's/ /,/g'
$ mysql -u <username> -p -Bse 'optimize tables <comma seperated list of tables>' <dbname>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment