星期六, 七月 01, 2006
當 mysqdump 遇到 Out of memory
當 MySQL 的資料量太大, 在使用 mysqldump的時後遇到 Out Of Memory 的時後該怎麼辦?
有以下兩種做法:
1. 設定 my.cnf, 設定以下參數, max_allowed_packet=16M 可隨機再調大.
[mysqldump] quick max_allowed_packet = 16M
2. 使用 -q (--quick) 的參數, 使用此參數就不會使用到 Memory.
使用範例: mysqldump -q -u root DB_NAME > DB_NAME.sql
原廠的說明是如下:
--quick,-qThis option is useful for dumping large tables. It forces mysqldump to retrieve rows for a table from the server a row at a time rather than retrieving the entire row set and buffering it in memory before writing it out.
發表迴響
PS: 若無法留言, 請先確認是否有打開 JavaScript, 造成您的困擾, 實在萬分對不起 Orz...(如果無法留言, 勞煩可以發信給我好嗎? 謝謝.)
註: 若您的留言被誤判, 我都會再自行看過, 不需要一直重覆張貼唷~)





