mysql - 导入大数据时的优化处理(import big file)

访问量: 152

导入之前,进行这样的设置:

优化inno DB:
修改数据库配置文件
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16

导入命令:

mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set unique_checks=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set foreign_key_checks=0;
Query OK, 0 rows affected (0.00 sec)

mysql> source your-sql-file.sql;

之后再把对应的内容改回来

订阅/RSS Feed

Subscribe

分类/category