MySQL OPTIMIZE all tables?

前端 未结 14 1964
迷失自我
迷失自我 2020-12-04 04:57

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 o

相关标签:
14条回答
  • 2020-12-04 05:34

    If you are accessing database directly then you can write following query:

    OPTIMIZE TABLE table1,table2,table3,table4......;
    
    0 讨论(0)
  • 2020-12-04 05:38

    for all databases:

    mysqlcheck -Aos -uuser -p 
    

    For one Database optimization:

    mysqlcheck -os -uroot -p dbtest3
    
    0 讨论(0)
提交回复
热议问题