我最近决定公司通过我得到我的主机切换,让我的老数据库移动到我的新的数据库,我一直在试图运行这个命令: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