MySQL Error Query database. Causejava.sql.SQLException: Incorrect key file for table ‘/tmp/#sql_181c
1,开发人员截图给我,后台报错如下:
Error Query database. Causejava.sql.SQLException: Incorrect key file for table ‘/tmp/#sql_181c_0.MYI’; tryto repair it;
分析,这种,大多数情况是tmp临时表空间不足,所以执行比较复杂的sql或者执行大表关联的时候,需要临时表资源较多,如果临时表资源少的话,就会保错。
2,看看tmp_table_size值
mysql> show variables like '%tmp%';
+----------------------------+------------+
| Variable_name | Value |
+----------------------------+------------+
| default_tmp_storage_engine | InnoDB |
| max_tmp_tables | 32 |
| slave_load_tmpdir | /tmp |
| tmp_table_size | 524288000 |
| tmpdir | /tmp |
+----------------------------+------------+
5 rows in set (0.00 sec)
mysql>
mysql> select 524288000/1024/1024/1024;
+--------------------------+
| 524288000/1024/1024/1024 |
+--------------------------+
| 0.488281250000 |
+--------------------------+
1 row in set (0.00 sec)
----------------------------------------------------------------------------------------------------------------
<版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!>
原博客地址: http://blog.csdn.net/mchdba/article/details/45895681
原作者:黄杉 (mchdba)
----------------------------------------------------------------------------------------------------------------
mysql>
查下 tmp_table_size的值,发现这个太小了才500M都不到,加大4倍试试
3,修改tmp_table_size值
mysql> set global tmp_table_size =2462177282;
Query OK, 0 rows affected (0.00 sec)
mysql>
改完了,让开发人员重新连接下数据库,貌似还是原来的错误,再加大一倍试试
mysql> set global tmp_table_size =5122177282;
Query OK, 0 rows affected (0.00 sec)
mysql>
然后让开发人员再登录mysql库,查询试试,OK了。
4,总结
这种情况,从运维dba角度,加大tmp_table_size的值,从开发dba角度,优化sql不要写那么效率低下的sql语句造成临时数据过大。
参考文章地址:
http://www.mysqlperformancetuning.com/a-fix-for-incorrect-key-file-for-table-mysql
MySQL Error Query database. Causejava.sql.SQLException: Incorrect key file for table ‘/tmp/#sql_181c相关推荐
- MySql 执行异常Cause: java.sql.SQLException: Incorrect key file for table
MySql 执行异常 问题现象 问题原因 解决方案 问题现象 今天测试环境执行sql图片报错,错误日记如下: org.springframework.jdbc.UncategorizedSQLExce ...
- ERROR 126 (HY000) at line 1: Incorrect key file for table '/tmp/#sql_7b09_0.MYI'; try to repair it
1.问题背景 我在slelect一个数据量很大的merge表时,并同时将select结果集insert到另外一张表中,报了如下错误: ERROR 126 (HY000) at line 1: Inco ...
- MySQL异常:Incorrect key file for table '/tmp/#sql_37b_1.MYI'; try to repair it
今天突然收到报警短信,提示网站有一个模块出现异常,当时我就方了 检查了下日志,发现异常如下: Caused by: java.sql.SQLException: Incorrect key file ...
- mysql Incorrect key file for table ‘/tmp/#sql_xxxx_0.MYI‘; try to repair it
查看information_schema的COLUMNS表,但是出现如下问题: root:information_schema> select * from COLUMNS; ERROR 126 ...
- [error] [mysql]:1034 Incorrect key file for table 'table_name'; try to repair it
[error] [mysql]:"1034 Incorrect key file for table 'table_name'; try to repair it" 现象描述: m ...
- mysql出现“Incorrect key file for table”解决办法
今天mysql突然出现以下错误: mysql> select * from test; ERROR 1034 (HY000): Incorrect key file for table 'te ...
- mysql old key files_mysql出现“Incorrect key file for table”解决办法
本文来自: https://www.cnblogs.com/zjoch/archive/2013/08/19/3267131.html 今天mysql突然出现以下错误: mysql> selec ...
- 重启服务器后mysql表损坏 Incorrect key file for table ‘.\axxxx.MYI‘; try to repair it“,“tourl“:““,.....
重启系统后mysql表损坏 Incorrect key file for table '.\axxxx.MYI'; try to repair it","tourl":& ...
- mysql中大数据表alter增加字段报错:1034 Incorrect key file for table 'table_name'; try to repair it...
mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it" 现 ...
最新文章
- 程序员四大忌 你该如何避免呢?
- 【Java】 剑指offer(36) 二叉搜索树与双向链表
- conflicting types for ‘方法名’ 的错误
- 1052 卖个萌 (20 分)
- 数据结构-栈3-栈的应用-就近匹配
- Qt学习笔记-各种对话框基本使用
- idea解决编译时出现的未结束的字符文字等错误
- 【JSTL】<c:if test=“”>没有else的解决方法
- Unity IOC简单认知
- 过滤器 和 拦截器的 6个区别,别再傻傻分不清了
- win7安装后计算机不在桌面,win7重装系统后进不了桌面的解决措施
- linux系统支持速达软件吗,速达3000系列常见问题100问
- 浏览器全屏相关常用代码
- python 拼音搜索中文_汉语转拼音工具、新华字典API——两个支持Python的中文资源...
- 数据库之Mysql索引、事务与存储引擎
- 友价商城破解版问题解答 附加最新商城2018仿友价T5商城源码系5月310日更新
- 加密解密,MySQL单行函数,数学函数字符串日期时间,流程控制,完整详细可收藏查询SQL
- HashMap的尾部遍历问题--Tail Traversing
- Android 笔记 ImageView 显示大图遇到的问题 以及 无损显示大图 的解决方案
- 关于手机验证码的获取与验证方法