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';# 因为我想在本地导入数据,而数据就在本地.# 有时候, ...
随机推荐
- MySQL新参数log_error_verbosity
在介绍这个参数前,我们先聊聊参数log_warnings.我们知道MySQL中,其中log_error定义是否启用错误日志的功能和错误日志的存储位置,log_warnings定义是否将告警信息(w ...
- sql 语句-初级进阶(二)
1.insert插入数据时注意事项: 每次插入一整行,不能半行或者是几列数据. 值与列数必须相同,包括数据类型也必须匹配. 不能为标识列指定值(就是最前面的那一序号列),它是自动增长的 列的数据类型为 ...
- Lcd(一)显示原理
一.LCD控制原理 S5PV210处理器中自带LCD控制器,控制LCD的显示,把 LCD 图像数据从一个位于系统内存的 video buffer 传送到一个外部的 LCD 驱动器接口. 类型: STN ...
- SQLServer删除数据列
删除数据列 开发或者生产过程中多建.错误或者重复的数据列需要进行删除操作. 使用SSMS数据库管理工具删除数据列 方式一 1.打开数据库->选择数据表->展开数据表->展开数据列-& ...
- Hadoop Compatibility in Flink
18 Nov 2014 by Fabian Hüske (@fhueske) Apache Hadoop is an industry standard for scalable analytical ...
- kernel笔记——网络收发包流程
本文将介绍网络连接建立的过程.收发包流程,以及其中应用层.tcp层.ip层.设备层和驱动层各层发挥的作用. 应用层 对于使用socket进行网络连接的服务器端程序,我们会先调用socket函数创建一个 ...
- JS中的六大数据类型
js中有六种数据类型,包括五种基本数据类型(Number,String,Boolean,Undefined,Null),和一种复杂数据类型(Object). typeof 操作符 由于js中的变量是松 ...
- vue给不同环境配置不同打包命令
第1步:安装cross-env 1 npm i --save-dev cross-env 第2步:修改各环境下的参数 在config/目录下添加test.env.js.pre.env.js. 修改pr ...
- 慢日志查询python flask sqlalchemy慢日志记录
engine = create_engine(ProdConfig.SQLALCHEMY_DATABASE_URI, echo=True) app = Flask(__name__) app.conf ...
- 【转】Android OkHttp3简介和使用详解
一 OKHttp简介 OKHttp是一个处理网络请求的开源项目,Android 当前最火热网络框架,由移动支付Square公司贡献,用于替代HttpUrlConnection和Apache HttpC ...