mysql加速导入数据的简单设置
mysql加速导入数据的简单设置
# 修改前查询参数值
show variables like 'foreign_key_checks';
show variables like 'unique_checks';
show variables like 'innodb_flush_log_at_trx_commit';
show variables like 'sync_binlog';
# 执行如下加速操作
SET GLOBAL foreign_key_checks=0;
SET GLOBAL unique_checks=0;
SET GLOBAL innodb_flush_log_at_trx_commit=0;
SET GLOBAL sync_binlog=0; # 执行具体的导入sql操作
-- ... # 将参数修改回原值
SET GLOBAL foreign_key_checks=1;
SET GLOBAL unique_checks=1;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
SET GLOBAL sync_binlog=1; # 如下是修改前后的比对qps和tps结果
---------+-------mysql-status-------+-----threads-----+-----slow-----+---bytes---+---------locks----------
time | QPS TPS ins upd del| run con cre cac| sql tmp Dtmp| recv send| lockI lockW openT openF
---------+--------------------------+-----------------+--------------+-----------+------------------------
22:45:40 | 0 796 796 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:41 | 0 735 735 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:42 | 0 722 722 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:43 | 0 767 767 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:44 | 0 845 845 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:45 | 0 893 893 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:46 | 0 858 858 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:47 | 0 960 960 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:48 | 0 984 984 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:49 | 0 971 971 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:50 | 0 940 940 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:51 | 0 866 866 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:52 | 0 1010 1010 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:53 | 0 914 914 0 0| 2 2 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:54 | 0 1025 1025 0 0| 2 2 1 1| 0 1 0| 0K 8K| 1 0 115 27
22:45:55 | 0 1025 1025 0 0| 2 2 0 1| 0 1 0| 0K 8K| 1 0 115 27
22:45:56 | 0 996 996 0 0| 2 2 0 1| 0 1 0| 0K 8K| 1 0 115 27
22:45:57 | 2 1012 1012 0 0| 2 3 0 0| 0 1 0| 1K 8K| 1 0 115 27
22:45:58 | 0 1124 1124 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:45:59 | 0 3636 3636 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
---------+-------mysql-status-------+-----threads-----+-----slow-----+---bytes---+---------locks----------
time | QPS TPS ins upd del| run con cre cac| sql tmp Dtmp| recv send| lockI lockW openT openF
---------+--------------------------+-----------------+--------------+-----------+------------------------
22:46:00 | 0 3845 3845 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:01 | 0 3797 3797 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:02 | 0 3824 3824 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:03 | 0 3871 3871 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:04 | 0 3892 3892 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:05 | 0 3861 3861 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:06 | 0 3904 3904 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:07 | 0 3924 3924 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:08 | 0 3857 3857 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:09 | 0 3941 3941 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:10 | 0 3876 3876 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:11 | 0 3872 3872 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:12 | 0 3732 3732 0 0| 2 3 0 0| 0 1 0| 0K 7K| 1 0 115 27
22:46:13 | 0 3659 3659 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:14 | 0 3763 3763 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:15 | 0 3746 3746 0 0| 2 3 0 0| 0 1 0| 0K 7K| 1 0 115 27
22:46:16 | 0 3735 3735 0 0| 2 3 0 0| 0 1 0| 0K 7K| 1 0 115 27
22:46:17 | 0 3751 3751 0 0| 2 3 0 0| 0 1 0| 0K 7K| 1 0 115 27
22:46:18 | 0 3889 3889 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
22:46:19 | 0 3797 3797 0 0| 2 3 0 0| 0 1 0| 0K 8K| 1 0 115 27
mysql加速导入数据的简单设置的更多相关文章
- mysql查询进程、导入数据包大小设置
mysql查询进程.导入数据包大小设置 zoerywzhou@163.com http://www.cnblogs.com/swje/ 作者:Zhouwan 2017-12-27 查询正在执行的进程: ...
- Hive数据导入——数据存储在Hadoop分布式文件系统中,往Hive表里面导入数据只是简单的将数据移动到表所在的目录中!
转自:http://blog.csdn.net/lifuxiangcaohui/article/details/40588929 Hive是基于Hadoop分布式文件系统的,它的数据存储在Hadoop ...
- 用python批量向数据库(MySQL)中导入数据
用python批量向数据库(MySQL)中导入数据 现有数十万条数据,如下的经过打乱处理过的数据进行导入 数据库内部的表格的数据格式如下与下面的表格结构相同 Current database: pyt ...
- Mysql mysqlimport 导入数据
在mysql 数据库中可以用 mysqlimport 工具来实现数据的导入!mysqlimport 导入数据简单,但是这个也要满足一定的条件 1.既然是把数据导入到数据库,你总有一个数据库用户账号吧 ...
- mysql导出导入数据
使用sql语句导出数据: 导出时如果不写绝对路径,会提示The MySQL server is running with the --secure-file-priv option so it can ...
- mysql 导出导入数据 -csv
MySql数据库导出csv文件命令: mysql> select first_name,last_name,email from account into outfile 'e://output ...
- 搜索引擎Solr系列(二): Solr6.2.1 从MySql中导入数据
一:建立MySql测试表,如下图: 二:solr导入配置: 1.新建demo core文件夹,并修改managed-schema里面的配置文件建立索引字段: 2.把mysql-connector-j ...
- MYSQL数据库导入数据时出现乱码的解决办法
我的一个网站在负载搞不定的情况下最终选择了数据库和程序分离的方式解决的高负载,但是再导入数据的时候出现了大量乱码,最终通过方法二解决掉导入数据的问题,后面再设计网站布局的时候数据库跟网站程序分离是个很 ...
- mysql本地导入数据
1.获得一个超级权限的用户 grant all on *.* to root@'127.0.0.1' identified by 'root';# 因为我想在本地导入数据,而数据就在本地.# 有时候, ...
随机推荐
- SQL Server -- 回忆笔记(三):ADO.NET之C#操作数据库
SQL Server知识点回忆篇(三):ADO.NET之C#操作数据库 1.连接数据库 (1)创建连接字符串: 使用windows身份验证时的连接字符串: private string conStr= ...
- spring3:多数据源配置使用
0. properties ####################################mysql########################################### d ...
- 周末班:Python基础之面向对象基础
面向对象基础 面向对象和面向过程 编程思想是什么,就是用代码解决现实生活中问题的思路. 面向过程 核心点在过程二字,过程指的是解决问题的步骤,说白了就是先做什么再干什么.这种解决问题的思路就好比是工厂 ...
- Python开发【第五篇】内置函数
abs() 函数返回数字的绝对值 __author__ = "Tang" a = -30 all() 函数用于判断给定的可迭代参数iterable中的所有元素是否都为True,如果 ...
- 深入Ambari Metrics 机制分析
0.简介 Ambari作为一款针对大数据平台的运维管理工具,提供了集群的创建,管理,监控,升级等多项功能,目前在业界已经得到广泛使用. Ambari指标系统( Ambari Metrics Syste ...
- Installing Supervisor and Superlance on CentOS
Installing Supervisor1 and Superlance2 on CentOS/RHEL/Fedora can be a little tricky, as the versions ...
- slice()和splice()区别
1.slice(start,end):方法可从已有数组中返回选定的元素,返回一个新数组,包含从start到end(不包含该元素)的数组元素. 注意:该方法不会改变原数组,而是返回一个子数组,如果想删除 ...
- 运行ConnectionDemo时遇到的问题及解决方案
20175227张雪莹 2018-2019-2 <Java程序设计> 运行ConnectionDemo时遇到的问题及解决方案 老师博客上提供确认数据库连接的代码 import static ...
- Spring-boot使用eclipse搭建项目(一)
https://blog.csdn.net/qq_37421862/article/details/80484625
- OCR技术浅析-无代码篇(1)
图像识别中最贴近我们生活的可能就是 OCR 技术了. OCR 的定义:OCR (Optical Character Recognition,光学字符识别)是指电子设备(例如扫描仪或数码相机)检查纸上打 ...