MySQL Tip: How To Check, Repair & Optimize All Tables in All Databases MySQL的秘訣:如何檢查,維修和優化的所有表格,在所有數據庫
Here is a simple command to auto repair, check and optimize all the tables in all databases running on a MySQL server :這裡是一個簡單的命令,以汽車修理,檢查和優化所有表格在所有數據庫上運行的MySQL服務器 :
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases mysqlcheck中美根- P的-自動修復-檢查-優化-所有數據庫
mysqlcheck is available in MySQL 3.23.38 and later. mysqlcheck可在MySQL 3.23.38和更高版本。
mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user. mysqlcheck使用SQL語句檢查表,維修表,分析表,優化表在一個便捷的途徑用戶。 It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed.它決定了報表,其中用於操作,您要執行,然後發送報表到服務器被處決。 The exact operations are determined by the underlying storage engine used.確切的行動是由潛在的存儲引擎使用。
You must execute it on running database.您必須執行它的運行數據庫。 It is recommended that you kill other incoming queries (like from your website) before running this which makes it a lot faster.它是建議你殺其他傳入的查詢(如從您的網站)之前運行,這使得它有很多的更快。 I simply stop my httpd server before running it.我只是停止我的httpd服務器,然後運行它。 You may want to use a您可能會想要使用 Site Unavailable網站無法使用 message instead so that the MySQL server is left alone.訊息,而不是使MySQL服務器是單獨留在家中。
Filed under提起下 Company公司 , , Database數據庫 , , Enterprise Software企業軟件 , , Headline News頭條新聞 , , How To如何 , , MySQL MySQL的 , , RDBMS RDBMS的 , , Tech Note技術說明 , , Web網頁 | |
| |
RSS 2.0 2.0 | |
Trackback Trackback跟踪 this Article |此文章|
Email this Article電子郵件此文章
You may also like to read你也可以想讀 |




May 3rd, 2008 at 4:10 pm 2008年5月3日在下午4時10分
Hi,嗨,
great command!偉大的指揮! But what about this:但有關此:
Don’t forget to FLUSH TABLES after execution of any of the following - REPAIR TABLE, TRUNCATE TABLE, OPTIMIZE TABLE, or ANALYZE TABLE on tables that are mapped into MERGE table.不要忘記沖水表後,執行下列任何一種-修理表,截斷表,優化表,或分析表,表是映射到合併表。
And shouldn´t we also run a ’sort-index’ ?和不應該,我們也執行'排序指數'嗎?