更新: 2011-08-30字體: 【大中小】點擊: 2
線上數據MySQLdump一次操作測試: A 2.26 B 2.8 A上 # time MySQLdump -u datatuan -ppasswd --databases datatuan > datatuan.sql real 5m39.516s user 0m40.898s sys 0m5.762s # du -sh datatuanlxu.sql 1.4G datatuan.sql 用nc拷貝: # time nc -w 1 jiadao 4444 < datatuanl.sql real 3m2.263s user 0m0.146s sys 0m4.224s A上做MySQLdump的時候可能需要的參數如下: MySQLdump -x, --lock-all-tables Locks all tables across all databases. This is achIEved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction and --lock-tables off. B上 # nc -l 4444 > datatuan.sql MySQL> create database datatuan; GRANT USAGE ON datatuan.* TO 'datatuan'@'%' IDENTIFIED BY 'passwd'; MySQL> GRANT all ON datatuan.* TO 'datatuan'@'%' IDENTIFIED BY 'passwd'; Query OK, 0 rows affected (0.00 sec) MySQL> Flush privileges; Query OK, 0 rows affected (0.00 sec) # time MySQL -uroot -pabdata datatuan -f < datatuan.sql[說明 datatuan_2010-09-15.sql] ERROR 1146 (42S02) at line 711: Table 'datatuan.TmpPlan' doesn't exist ERROR 1146 (42S02) at line 1139: Table 'datatuan.TmpPlan' doesn't exist ERROR 1146 (42S02) at line 1588: Table 'datatuan.TmpPlan' doesn't exist real 29m12.757s user 0m33.248s sys 0m1.358s