ERROR 126 HY000 Incorrect key file for table '/tmp/ sql 1
author:skate
time:2012/06/25
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it
案例:
mysql> insert into t1 select * from t1;
^[[AQuery OK, 24576 rows affected (0.44 sec)
Records: 24576 Duplicates: 0 Warnings: 0
mysql> insert into t1 select * from t1;
Query OK, 49152 rows affected (1.90 sec)
Records: 49152 Duplicates: 0 Warnings: 0
mysql> insert into t1 select * from t1;
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it
从上面的情况看,好似空间的问题,因为前几次insert都成功了,查看磁盘空间如下:
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.3G 5.0G 50M 100% /
/dev/sda1 99M 12M 83M 13% /boot
tmpfs 125M 0 125M 0% /dev/shm
/dev/sdb1 7.7G 183M 7.2G 3% /data
在查看mysql数据目录情况
mysql> show variables like '%dir%';
+-----------------------------------------+------------------------------------+
| Variable_name | Value |
+-----------------------------------------+------------------------------------+
| basedir | /usr/local/mysql |
| binlog_direct_non_transactional_updates | OFF |
| character_sets_dir | /usr/local/mysql/share/charsets/ |
| datadir | /usr/local/mysql/data/ |
| innodb_data_home_dir | /data/mysql/data |
| innodb_log_group_home_dir | /data/mysql/data |
| innodb_max_dirty_pages_pct | 75 |
| lc_messages_dir | /usr/local/mysql/share/ |
| plugin_dir | /usr/local/mysql/lib/mysql/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+-----------------------------------------+------------------------------------+
11 rows in set (0.01 sec)
从上面看确实是空间满了,然后调整变量“tmpdir”和“slave_load_tmpdir”,然后重启mysql服务,结果就ok了
[mysqld]
...
tmpdir=/data/mysql
slave_load_tmpdir=/data/mysql
...
[root@localhost mysql]# support-files/mysql.server restart
Shutting down MySQL (Percona Server).....[ OK ]
Starting MySQL (Percona Server)...[ OK ]
[root@localhost mysql]# bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> insert into t2 select * from t2;
ERROR 1046 (3D000): No database selected
mysql> use test;
Database changed
mysql> insert into t2 select * from t2;
Query OK, 98304 rows affected (4.48 sec)
Records: 98304 Duplicates: 0 Warnings: 0
这个就是我在改数据的目录时,忘记改这个变量值了。
----end----
ERROR 126 HY000 Incorrect key file for table '/tmp/ sql 1相关推荐
- 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 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 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 '/ ...
- 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”解决办法
今天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 ...
- [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 执行异常Cause: java.sql.SQLException: Incorrect key file for table
MySql 执行异常 问题现象 问题原因 解决方案 问题现象 今天测试环境执行sql图片报错,错误日记如下: org.springframework.jdbc.UncategorizedSQLExce ...
- 重启服务器后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" 现 ...
最新文章
- 深度linux创建微信图标,Deepin Linux 下基于deepin-wine的微信图标不见的问题解决
- 第一人称视角的一种解决方案
- 32岁学python 人工智能_python深入学习好还是直接学人工智能好?
- Django 自定义表名
- 23. which命令
- socket php验证客户端验证,用Socket发送电子邮件(利用需要验证的SMTP服务器)_php基础...
- LINQ能不能用系列(二)LINQ to SQL 效率比对
- java多线程(简单介绍)
- 【带钢厚度预测】基于matlab GUI SVM带钢厚度预测【含Matlab源码 173期】
- c语言王者荣耀程序代码,王者荣耀:张大仙直言C语言上手并不难,玩家:张工程师成了?...
- PMCAFF外包大师合作模式介绍
- pc彩色版伏魔记开放Java源码
- 遥感资源大放送(下)| 11 个经典遥感数据集
- Python 根据出生日期判断星座
- 大学物理实验长度的测量实验报告_长度测量实验报告.doc
- C语言 | 位域的使用详解
- Android隐藏软键盘
- Oracle之创建定时任务
- 实验一 顺序与选择结构(Python 头歌)
- 十月下旬腾讯 网易游戏 百度迅雷校园招聘笔试题集锦 第271 330题