Google Cloud SQL错误的密钥文件

时间:2015-05-07 13:34:27

标签: mysql google-cloud-sql

有几次,我尝试对涉及order by语句的Google Cloud SQL进行查询,但只是让查询失败并显示错误

Incorrect key file for table '/cloudsqltmp/#sql_44f4_1.MYI'; try to repair it

这听起来像/ cloudsqltmp /分区正在填满我的临时表。然而,结果集并不大,并且执行该查询的程序在其他几个场合也这样做了,所以我怀疑这个空间实际上已经填满了别人的临时表。我能够通过多次重启实例来清除这个问题(我假设它最终给了我一台新机器,或者空间清理完了),但这看起来非常不优雅。

  1. 如果再次发生,是否有更好的方法来解决这个问题?
  2. 有没有更好的方法来防止这种情况发生?
  3. 如果我对发生的事情的假设是错误的 - 究竟发生了什么?

1 个答案:

答案 0 :(得分:0)

What I would recommend doing is:

Creating a Google Compute Engine instance and run MySQL on it. This way if you run into this problem again, you can use the follow solution below.

1) Modify the /tmp partition to have more space. There is a very useful link here on how to do it.

2) Create a CronJob to clear the /tmp. If you are not comfortable with CronJob, I found another tool called tmpreaper. To install it, run md5(). Also use InnoDB instead of MyISIAM. Google recommends using it.

3) You are correct to assume that /tmp is getting full since restarting the instance resolves the issue

I hope my recommendations were helpful.