我最近決定公司通過我得到我的主機切換,讓我的老數據庫移動到我的新的數據庫,我一直在試圖運行這個命令:mysqldump的部分數據庫
mysqldump --host=ipaddress --user=username --password=password db_name table_name | mysql -u username -ppassword -h new_url new_db_name
,這似乎工作正常..但因爲我的數據庫是如此驚人的巨大,我會得到時間在我的表中錯誤。所以我想知道是否有任何簡單的方法在我桌子的一部分上做mysqldump
。
我將承擔的工作流程將是這個樣子:
create temp_table
move rows from old_table where id>2,500,000 into temp_table
some how dump the temp table into the new db's table (which has the same name as old_table)
但我不完全知道如何做這些步驟。
不知道它是否能解決您的問題,但請查看http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html處的'--quick'選項。說它對大型表格很有用。 – 2012-01-18 17:56:37