MySQL OPTIMIZE all tables?

544    Asked by DeirdreCameron in Python , Asked on May 19, 2021

description - MySQL has an OPTIMIZE TABLE command which can be used to reclaim unused space in a MySQL install. Is there a way (built-in command or common stored procedure) to run this optimization for every table in the database and/or server install, or is this something you'd have to script up yourself?

Answered by Gordon Guess

Try using mysqlcheck to solve mysql optimize all tables, at the command line to run the optimization table for every table in the database and to install the server .

At one database:

  mysqlcheck -o 

At all databases:

mysqlcheck -o --all-databases



Your Answer

Interviews

Parent Categories