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';# 因为我想在本地导入数据,而数据就在本地.# 有时候, ...
随机推荐
- 自己手写一个SpringMVC 框架
一.了解SpringMVC运行流程及九大组件 1.SpringMVC 的运行流程 · 用户发送请求至前端控制器DispatcherServlet · DispatcherServlet收到请求调用 ...
- Delphi Record To Stream
type TUserInfo = record sUserId,sUserName:String; iUserCount:integer; end; procedure TForm1.Button1C ...
- 【原】Java学习笔记021 - Object
package cn.temptation; public class Sample01 { public static void main(String[] args) { // 类 Object: ...
- 6.1Python数据处理篇之pandas学习系列(一)认识pandas
目录 目录 (一)介绍与测试 2.作用: 3.导入的格式 4.小测试 (二)数据类型 1.两种重要的数据类型 2.pandas与numpy的比较 目录 (一)介绍与测试 号称处理数据与分析数据最好的第 ...
- docker-compose编排项目redis容器实现主从复制
一.pip管理工具安装 docker-compose是python项目,所以安装需要通过python下的包管理工具pip安装.一般linux服务器都会预安装有python环境,所以优先检查python ...
- Linux文件目录
简介: Linux 内核最初由芬兰的 Linus Torvalds 开发,后来他组建了团队,Linux 内核由这个团队维护. GNU 组织开发了很多核心软件和基础库,例如 GCC 编译器.C语言标准库 ...
- git如何设置ssh密钥
git设置ssh密钥 目前git支持https和git两种传输协议,github分享链接时会有两种协议可选: 1.Clone with SSH 2.Clone with HTTPS git在使用htt ...
- Python从入门到放弃Day01
Py的第一天,无非是讲一些关于电脑的一些常见的基本常识,硬件之类的cpu啊.硬盘啊.显卡啊.内存条啊什么的,之后就还有一些除了windows之外的操作系统,我之前是学网络的,Readhat也学了一部分 ...
- Zabbix 3.4.7针对一些主机设置期间维护
场景说明: 由于公司有些主机设置了定时开机关机,每次开机关机得时候都会发邮件告警,每次都需要值班人员提醒,为了处理这种无效告警,可以在zabbix中设置维护 zabbix中的维护---维护期间:用来设 ...
- Go语言中定时器cron的基本使用
安装:go get github.com/robfig/cron 如果出不去就用gopm 例子: package main import ( "fmt" "github ...