星期六, 七月 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, -q

This 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.

作者 jon ( My_Note ) :: 迴響 (0):: 靜態連結網址
相關標籤
Add this page to del.icio.us Add this page to Yahoo Taiwan's bookmark Add this page to MyShare

發表迴響

標題

內容 (限制 1000 字)

暱稱

電子郵件

個人網頁


 authimage


PS: 若無法留言, 請先確認是否有打開 JavaScript, 造成您的困擾, 實在萬分對不起 Orz...(如果無法留言, 勞煩可以發信給我好嗎? 謝謝.) 註: 若您的留言被誤判, 我都會再自行看過, 不需要一直重覆張貼唷~)