我mysqldump database > output.sql
用来转储数据库中的所有数据。输出文件的大小约为3.3 GB。我正在使用mysql < output.sql
它导入它,但它已运行超过24小时仍然没有完成。
这是正常的吗?有没有办法加快进口?
mysql> SHOW VARIABLES LIKE '%innodb%';
+-----------------------------------------+------------------------+
| Variable_name | Value |
+-----------------------------------------+------------------------+
| have_innodb | YES |
| ignore_builtin_innodb | OFF |
| innodb_adaptive_hash_index | ON |
| innodb_additional_mem_pool_size | 1048576 |
| innodb_autoextend_increment | 8 |
| innodb_autoinc_lock_mode | 1 |
| innodb_buffer_pool_size | 8388608 |
| innodb_checksums | ON |
| innodb_commit_concurrency | 0 |
| innodb_concurrency_tickets | 500 |
| innodb_data_file_path | ibdata1:10M:autoextend |
| innodb_data_home_dir | |
| innodb_doublewrite | ON |
| innodb_fast_shutdown | 1 |
| innodb_file_io_threads | 4 |
| innodb_file_per_table | OFF |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_flush_method | |
| innodb_force_recovery | 0 |
| innodb_lock_wait_timeout | 50 |
| innodb_locks_unsafe_for_binlog | OFF |
| innodb_log_buffer_size | 1048576 |
| innodb_log_file_size | 5242880 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | ./ |
| innodb_max_dirty_pages_pct | 90 |
| innodb_max_purge_lag | 0 |
| innodb_mirrored_log_groups | 1 |
| innodb_open_files | 300 |
| innodb_rollback_on_timeout | OFF |
| innodb_stats_on_metadata | ON |
| innodb_support_xa | ON |
| innodb_sync_spin_loops | 20 |
| innodb_table_locks | ON |
| innodb_thread_concurrency | 8 |
| innodb_thread_sleep_delay | 10000 |
| innodb_use_legacy_cardinality_algorithm | ON |
+-----------------------------------------+------------------------+
37 rows in set (0.12 sec)
mysql> SHOW VARIABLES LIKE '%key_buffer%';
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| key_buffer_size | 16777216 |
+-----------------+----------+
1 row in set (0.03 sec)
mysql> SHOW VARIABLES LIKE '%table%';
+----------------------------+----------+
| Variable_name | Value |
+----------------------------+----------+
| big_tables | OFF |
| innodb_file_per_table | OFF |
| innodb_table_locks | ON |
| lower_case_table_names | 0 |
| max_heap_table_size | 16777216 |
| max_tmp_tables | 32 |
| old_alter_table | OFF |
| sql_big_tables | OFF |
| table_definition_cache | 256 |
| table_lock_wait_timeout | 50 |
| table_open_cache | 64 |
| table_type | MyISAM |
| tmp_table_size | 16777216 |
| updatable_views_with_limit | YES |
+----------------------------+----------+
14 rows in set (0.00 sec)
此外,这些表格是InnoDB
—
Gordon 2010年