MySql磁盘占满,阿里云提示“The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute “

今天照常打开日志文件查看日志,结果发现一大堆报错:“The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement”,遂查了一下原来是阿里云的数据库被锁了

锁住的原因是因为磁盘占用满了,触发了阿里云的保护机制,自动给锁上了

我们可以去分析一下是哪些表占用了多的空间,通过命令

select TABLE_NAME, concat(truncate(data_length/1024/1024,2),’ MB’) as data_size,
concat(truncate(index_length/1024/1024,2),’ MB’) as index_size
from information_schema.tables where TABLE_SCHEMA = ‘数据库名称’
group by TABLE_NAME
order by data_length desc;
在这里插入图片描述

可以看到排在前面几个的都是数据和索引占用比较大的,这时候就可以根据自身情况对这些表进行相应数据的删除操作
通过Drop(删除整个表)或者truncate(只删除里面的数据)将表里面的数据给清理干净即可
在这里插入图片描述

注意此时无法重启,因为数据库状态还是在锁定中,清理完成后等待几分钟便可恢复正常

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
"The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement." 这个错误信息表明MySQL服务器正在使用LOCK_WRITE_GROWTH选项,导致无法执行该语句。这是阿里云的一个保护策略,当空间剩余不足时,禁止数据写入。你可以使用Navicat执行以下SQL语句来查看剩余空间大小。另外,有时候这个问题可能需要重启MySQL才能释放,因为这个文件是系统文件,很难找到。而且,如果使用了空间后,它并不会自动释放,这确实很令人困扰。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [mysql报错The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot ...](https://blog.csdn.net/qq_42500588/article/details/126420879)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement](https://blog.csdn.net/u013752219/article/details/131003195)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值