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';# 因为我想在本地导入数据,而数据就在本地.# 有时候, ...
随机推荐
- iOS 设置View阴影
iOS 设置View投影 需要设置 颜色 阴影半径 等元素 UIView *shadowView = [[UIView alloc] init]; shadowView.frame = CGRectM ...
- 【eclipse】mybatis配置文件创建与mapper接口文件创建
什么是mybatis: MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射. mybatis配置文件: <?xml version="1.0" ...
- js 学习之路6: if...else...条件语句的使用
1.1 if (...) { ... } else { ... } <!DOCTYPE html> <html> <meta http-equiv="Conte ...
- C++Primer第五版学习笔记
<C++ Primer>Learning Note 程序实例下载地址:http://www.informit.com/title/0321714113 第一章 开始 ...
- Ubuntu下安装JDK详细教程
Ubuntu下安装JDK详细教程 作者:凯鲁嘎吉 - 博客园http://www.cnblogs.com/kailugaji/ Ubuntu版本:Ubuntu-12.04.5-desktop-i386 ...
- 黏包现象之TCP
老师的博客:http://www.cnblogs.com/Eva-J/articles/8244551.html#_label5 server #_*_coding:gbk*_ from socket ...
- PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "ambari", database "ambari", SSL off
On your Postgres server, you will need to update your pg_hba.conf file to allow access for the ambar ...
- git-将dev代码合并到test
1. 在dev分支上刚开发完项目,执行以下命令: git add git commit -m 'dev' git push -u origin dev 2.切换到test分支上 如果是多人开发,先把远 ...
- Skyline 7 版本TerraExplorer Pro二次开发快速入门
年底了,给大家整理了一下Skyline 7版本的二次开发学习初级入门教程,献给那些喜欢学习的年轻朋友. 我这整理的是Web控件版本的开发示例,里面页面代码保存成html,都可以直接运行的. 测试使用的 ...
- 微信小程序:动画(Animation)
简单总结一下微信动画的实现及执行步骤. 一.实现方式 官方文档是这样说的:①创建一个动画实例 animation.②调用实例的方法来描述动画.③最后通过动画实例的 export 方法导出动画数据传递给 ...