Mysql导入数据库过程报错:The total number of locks exceeds the lock table size

MySQL5.6解决‘’(1206)The total number of locks exceeds the lock table size‘’问题 在往另一张表INSERT大数据量数据的时候,报出“The total number of locks exceeds the lock table size”这个问题,经查询相关资料,发现是因为innodb_buffer_pool_size不够大的原因,现解决方法步骤如下: 1.在进入MySQL客户端控制台输入如下命令: show variables like "%_buffer%"; 一般情况下innodb_buffer_pool_size默认是134217728byte,也就是1... 阅读详情
问题:
使用命令从a库批量导入多张表的数据到b库: 
INSERT IGNORE INTO iris.`iris4` SELECT * FROM `seiki_test`.`iris4` ;  
报错如下:
查询:INSERT IGNORE INTO iris.`iris4` SELECT * FROM `seiki_test`.`iris4` ;

错误代码: 1206
The total number of locks exceeds the lock table size

执行耗时   : 0 sec
传送时间   : 0 sec
总耗时      : 5 min 39 sec


解决方案: 
发生此种报错表示Mysql数据库的参数innodb_buffer_pool_size当前配置的大小已经不足够支持你的操作所需缓冲空间了。。
此参数用来设置innodb存储引擎缓存表和索引数据的内存大小。当数据库的innodb表进行大批量数据的插入、更新和删除操作的时候,可能发生此种情况。
需要通过手动修改此参数大小,
临时生效(重启会后失效):
查看当前“innodb_buffer_pool_size”的大小(单位为字节):
show global variables like '%nodb_buffer_pool%';

根据服务器配置和需求情况调整参数大小(调整为 1G;专用于做数据库的服务器,可按总内存的70~80%设置):
set @@global.innodb_buffer_pool_size=1*1024*1024*1024;
或
set  global innodb_buffer_pool_size=1*1024*1024*1024;


要想永久生效,需修改配置文件my.ini(windows环境:my.ini;linux系统环境:my.cnf)文件:
在标签[mysqld]中增加如下一行:
innodb_buffer_pool_size=1G
重启后永久生效。
mysql大批量删除(修改)The total number of locks exceeds the lock table size 错误的解决办法 mysql大批量删除(修改)报 The total number of locks exceeds the lock table size 错误的解决办法 阅读详情

相关推荐

西门子S7-200 SMART PLC高速计数器与增量式编码器实战配置指南

在工业自动化控制系统中,传感器是将物理量转换为电信号的关键组件,其中编码器作为核心的位置与速度检测元件,其工作原理基于光电或磁电效应,将机械位移转换为脉冲序列。增量式编码器通过输出相位差90度的A/B两相脉冲,不仅能实现精确的位移测量,还能通过相位关系自动判别运动方向,并通过倍频技术提升分辨率。其技术价值在于为PLC等控制器提供了实时、高精度的位置反馈,是实现闭环控制、提升系统精度与可靠性的基础。在包装机械、物料输送、绕线设备等应用场景中,编码器与PLC高速计数器的协同工作是实现精确定位、定长切割与速度控制

weixin_29178069的博客 396

MYSQL解决 The total number of locks exceeds the lock table size 问题

当我们对Mysql 中的表进行大批量的分组,查询、 创建的时候经常会出现这个问题,他翻译过来大概是这个意思,总数已经超过锁定表的大小。一般出现这个原因会有两种可能:1.MySQL的临时表过小也就是tmp_table_sizetmp_table_size:它规定了内部内存临时表的最大值,每个线程都要分配。(实际起限制作用的是tmp_table_size和max_heap_table_size的最小值...

dingweiye123的博客 6万+

保姆级教程:在华为云Ubuntu服务器上快速搭建RAGflow开发环境(避坑指南)

本文提供了一份在华为云Ubuntu服务器上快速搭建RAGflow开发环境的保姆级教程。针对网络拉取镜像等常见问题,详细介绍了从服务器选型、系统优化、Docker配置到RAGflow部署与验证的全流程,并给出生产环境调优建议,帮助开发者高效避坑,快速构建企业级应用环境。

weixin_29250403的博客 86

5.7版本的mysql错误1206 - The total number of locks exceeds the lock table size

当数据库的数据量比较大(上千万条数据)时,在对数据库进行增删操作时,出现了错误:1206 - The total number of locks exceeds the lock table size 原因是:数据库现有的缓存池内存较小导致的。 解决方法如下: 首先找到并打开MYSQL的命令行控制台 输入password,就是localhost的密码,打开本地数据 然后输入:show variables like "%_buffer%"; 查找到缓存池的内存...

dongshaoxia0的博客 7157

Apache NiFi新手必看:从零开始的数据流设计入门教程(含实战案例)

本文为Apache NiFi新手提供从零开始的数据流设计入门指南。通过实战案例,详细讲解了如何利用这一强大的数据采集工具,以可视化拖拽方式构建自动化数据流,实现从文件监控、内容处理到数据入库的全流程,并涵盖核心概念、环境搭建及生产环境调优要点。

weixin_29066781的博客 149

一口气看完TransformerXL详细解释带代码一:相对位置编码

相对位置编码(Relative Position Encoding)是Transformer模型中用于捕捉序列元素间相对位置关系的一种方法,与绝对位置编码(如BERT中的固定位置嵌入)不同,它直接建模元素之间的相对距离,从而更灵活地处理长序列或不同长度的序列。1. 为什么需要相对位置编码?​。

m0_73426548的博客 1427

mysql 1206 - The total number of locks exceeds the lock table size

mysql 1206 - The total number of locks exceeds the lock table size

susu1083018911的博客 2744

金蝶ERP元数据解析:字段属性与表结构映射实战

本文深入解析金蝶ERP元数据的核心价值与应用实践,详细介绍了字段属性与表结构映射的关键技术。通过缓存获取与工具类直连两种方案对比,结合实际案例展示元数据在数据库校验、动态表单生成等场景的应用,帮助开发者高效解决二次开发中的常见问题。

weixin_33738555的博客 433

MySQL5.7解决‘’(1206)The total number of locks exceeds the lock table size‘’问题

使用mysql将同一数据库的表格数据(根据条件筛选的部分数据)转换到当前数据库下另一个表格中,使用了插入和删除操作,由于数据量较大导致报错:‘’The total number of locks exceeds the lock table size‘’。这里使用的版本为MySQL5.7,经过查询相关解决办法,根据自己的MySQL版本将解决方法总结如下: 1.打开MySQL命令行控制台

layman2016的博客 1万+

MATLAB与ROS联合仿真——控制类功能模块介绍

MATLAB与ROS联合仿真——控制类功能模块介绍

慕羽★的博客 2353

【深度学习新浪潮】李飞飞团队VAGEN框架深度解析:让VLM智能体学会“三思而后行“

VAGEN框架的真正价值,不仅在于性能指标的突破,更在于重新定义了VLM智能体的发展方向——人工智能的进步不应只追求"做得对",更要实现"想得清"。李飞飞团队通过强制显式思考、动态表示适配和精细化奖励三大创新,让智能体第一次具备了可解释的世界建模能力。正如人类通过"观察-预测-行动"认识世界,VAGEN为AI注入的这种思考范式,或许正是通往通用人工智能的关键一步。对于开发者而言,开源的VAGEN框架不仅提供了强大的工具,更揭示了一个重要理念:让AI学会思考,比让它学会执行更重要。

专注:太空算力、AI infra、异构调度、大模型成本工程 281

Mysql查询报错:The total number of locks exceeds the lock table size

为何会出现这种错误 这是由于innodb_buffer_pool_size过小导致的。在MySQL5.5之前,广泛使用的和默认的存储引擎是MyISAM,MyISAM使用操作系统缓存来缓存数据,InnoDB需要innodb buffer pool中处理缓存,当InnoDB表执行大批量数据的增删改查时,就需要有足够的innodb buffer pool 空间。 如何设置缓冲池大小 innodb_buffer_pool_size默认大小为8388608(即8M ∗\ast∗ 1024 ∗\ast∗ 102.

大人的博客 3662

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

MySQL报错:The total number of locks exceeds the lock table size

风吹起了从前,看着天边似在眼前,万般流连~

Wind的博客 5161

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

解决The total number of locks exceeds the lock table size错误

mysql在进行大批量的数据操作时,会报“The total number of locks exceeds the lock table size”,特别是执行create、update语句的时候,在出现错误的那段查询语句之前写上这么一句话:show variables like "%_buffer%";SET GLOBAL innodb_buffer_pool_size=67108864;问题...

黄饱饱 3万+

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

mysql Error:The total number of locks exceeds the lock table size

今天在创建表的时候报错如下:    Error: The total number of locks exceeds the lock table size 解决办法:

wulantian的专栏 2564

MySQL 报错:The total number of locks exceeds the lock table size

MySQL 报错:The total number of locks exceeds the lock table size

自成背后的博客 4659

mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

1. 问题背景         InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoDB的配置默认是被注释起来的。在实际使用时,发现不少人只是把mysql的配置文件拷贝到需要的路径下后,就启动mysqld,而建表时偏偏又指定engine=innodb。正常情况下,即使不显式配置inn

slvher的专栏 1万+

mysql 数据库缓存调优之解决The total number of locks exceeds the lock table size错误

环境: mysql5.6.2 主从同步(备注:需操作主库和从库) 一、InnoDB表执行大批量数据的更新,插入,删除操作时会出现这个问题,需要调整InnoDB全局的innodb_buffer_pool_size的值来解决这个问题,并且重启mysql服务。 遇到的问题: mysql报错如下: The total number of locks exceeds the lock table size错误 二、解决办法 2.1、登录主库查看buffer_pool_size大小...

u011250186的博客 2008

Mysql插入报错:SQL state [HY000] error code [1206]; The total number of locks exceeds the lock table size

现象: 项目生产环境中时间调度插入数据时出现这样一个报错: org.springframework.orm.hibernate4.HibernateJdbcException: JDBC exception on Hibernate data access : SQLException for SQL [n/a]; SQL state [HY000]; error code [1206]; The total number of locks exceeds the lock table size; ne

Mr_JK的专栏 1938

mysql报错-ERROR 1206 (HY000)- The total number of locks exceeds the lock table size-的解决方法

mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法 问题背景 MySQL5.6中,采用innodb引擎的数据表中数据量不断增大(如单表数百万记录),执行一些大批量的updateSQL语句时会因默认 的引擎参数太小而报错,典型的错误类型如下: ERROR 12

zhanglao33的博客 5214

MySQL大表加字段,新增字段迁移过程报错the total number of locks exceeds the lock table size错误解决方案

  报错原因:the total number of locks exceeds the lock table size错表明mysql的默认配置无法满足大表的操作的需求了,然后需要我们手动去配置InnoDB表执行大批量数据的更新,插入,删除操作时会出现这个问题,需要调整InnoDB全局的innodb_buffer_pool_size的值来解决这个问题,并且重启mysql服务。 1.查询inn...

Kally_Wang的专栏 2928

【mysql】error code:1206 the total number of locks exceeds the lock table size

在处理大批量数据一次存储在数据库中时,可能会出现这种异常,是由于超过了MySQL缓冲池字节大小的限制,下面看解决办法: 执行命令: show variables like "%_buffer_pool_size%"; 看下当前的缓冲池字节大小限制是多少,默认的innodb_buffer_pool_size是8388608, 那么就要修改 innodb_buffer_pool_size的值,我...

weixin_42209881的博客 6788

MySQL插入大批量数据时报错“The total number of locks exceeds the lock table size”的解决办法

事情的原因是:我执行了一个load into语句的SQL将一个很大的文件导入到我的MySQL数据库中,执行了一段时间后报错“The total number of locks exceeds the lock table size”。 首先使用命令show variables like '%storage_engine%'查看MySQL的存储引擎: mysql> show variables like '%storage_engine%'; +----------------------...

u011250186的博客 2556

mysql中插入语句过多,导致遇到The total number of locks exceeds the lock table size错误的问题...

在Linux环境下,mysql插入语句过多而导致报错问题。The total number of locks exceeds the lock table size百度翻译以后是:锁的总数超过了锁表的大小。网上查了查以后找到的解决方案是: InnoDB表执行大批量数据的更新,插入,删除操作时会出现这个问题,需要调整InnoDB全局的innodb_buffer_pool_size的值来解...

weixin_30567471的博客 483
上一篇: Mysql的 load data infile 的用法
下一篇: Mysql关闭general日志、binlog日志设置失效并自动删除
世樹
博客等级 码龄15年 37粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值