MYSQL ERROR 1194 (HY000)

操作系统文件限制大小导致 MYSQL ERROR 1194 (HY000): Table is marked as crashed and should be repaired 问题处理

同事反馈应用在执行查询某张表时候报ERROR 1194 (HY000): Table is marked as crashed and should be repaired 错误

mysql> select * from ims_stat_msg_history where module=‘basic‘ and message=‘0‘ and createtime>=UNIX_TIMESTAMP(‘2015-03-04‘) LIMIT 0, 10;ERROR 1194 (HY000): Table ‘ims_stat_msg_history‘ is marked as crashed and should be repaired

通过网络搜索得出的大概问题原因为索引页损坏或表出现错误,网络上提供2种解决方案

  • 使用myisamchk 命令进行修复 myisamchk -c -r /var/lib/mysql/wx/ims_stat_msg_history.
  • 使用mysql 命令 repair table ims_stat_msg_history 进行修复.

通过使用上面两种解决方案,此问题依然存在,通过核查表发现表大小刚好为2G(1073741312/1024/1024)*2

-rw-rw----    1 mysql    mysql    1073741312 Mar 04 17:59 ims_stat_msg_history.MYD-rw-rw----    1 mysql    mysql     321451008 Mar 04 18:22 ims_stat_msg_history.MYI-rw-rw----    1 mysql    mysql          8937 Mar 28 2014  ims_stat_msg_history.frm

随着这条线索核查操作系统的limit (/etc/security/limits) 发现default有设置fssize 为2097151 和文件已经达到的大小2G刚好一致,这里我将此参数改为-1 ,然后重新切换一下用户环境后重启mysql 
重启mysql后,再次执行repair table ims_stat_msg_history进行修复,经过修复后测试,表恢复正常!

总结:

  • 对于网络上提供的解决方案,在不十分清楚的情况下,需要反复确认操作,最好进行先备份
  • 对于使用了修复方案还是存在问题,需要多扩展思路和方向进行解决
时间: 2024-08-25 06:52:04

MYSQL ERROR 1194 (HY000)的相关文章

[mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

From: http://m.blog.csdn.net/blog/langkeziju/13511411 我的MySQL版本为5.6.14版本,是二进制包安装的(虽然是二进制包安装的,但是以下问题同样适用于源码安装包安装的MySQL) 今天在我的测试库上添加一个新用户,报错: [[email protected] ~]$ mysql -uroot -p123456 Warning: Using a password on the command line interface can be in

mysql ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it

[[email protected] ~]# df -h 查看是否空间不足 在查看mysql数据目录情况 mysql> show variables like '%dir%'; +-----------------------------------------+------------------------------------+ | Variable_name                           | Value                              |

Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法

我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 这个错是链接时报的错,要链接必须启动.修复的时候首先要启动mysql. 首先来了解一下 mysql.sock的作用: Mysql有两种连接方式: (1),TCP/IP (2),socket 对mysql.sock来说,其

[mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value 解决方法

在MySQL数据库中的mysql.user表中使用insert语句添加新用户时,可能会出现以下错误: ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value 原因是在my.ini配置文件中有这样一条语句 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 指定了严格模式,为了安全,严格模式禁止通过insert 这种形式直接修改mysql库中的user表进行添加新用户

mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

解决方案如下: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") 原文地址:https://www.cnblogs.com/youran-he/p/8182280.html

Linux中mysql进入命令行报错:MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.99.192' (111)

场景:在Linux中安装mysql01和mysql02,通过VIP虚出一个VIP=192.168.99.192,mysql01为主ip为192.168.99.153,mysql02为备机ip为192.168.99.154 此时VIP在mysql01上通过 mysql01上连接VIP :mysql -h 192.168.99.192 -P 3306   结果是可以正常进入mysql命令行: 通过mysql02上远程连接VIP 会在界面上报错:mysql error 2003(HY000):Can'

mysql - ERROR 1114 (HY000): The table is full

mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/730579/error-1114-hy000-the-table-is-full df -H 硬盘满了 原文地址:https://www.cnblogs.com/rgqancy/p/10937638.html

mysql ERROR 1396(HY000)

mysql> create user [email protected]'localhost' identified by '[email protected]'; ERROR 1396 (HY000): Operation CREATE USER failed for 'jumpserver'@'localhost' 创建用户时,出现报错,有很多人都说刷新下权限就行: flush privileges 经过测试,不能成功解决问题,后来想到可能其他表中仍然有用户信息,查看 select * fr

mysql ERROR 1290 (HY000):

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot exe 在Mysql集群中创建用户时.出现如下错误! mysql> create user 'testuse'@'localhost' identified by '111111';ERROR 1290 (HY000): The MySQL server is running with the --ski