如题:我用的是mysql5.1
对一个数据量为3G,索引2G,执行一个alter table add 操作,mysql -hxx -uxx -Dxx -e“”
会出现  
ERROR 1317 (70100) at line 2: Query execution was interrupted

解决方案 »

  1.   

    难道表有损坏吗你试试用mysqldump导出这个表的全部内容
      

  2.   

    也可能是用-e这个参数导致系统out of memory 那么就进入mysql执行你的alter table语句  另外执行你语句的时候监控下你的系统内存消耗情况
      

  3.   

    表应该没有损坏,因为线上都正在使用这张表。另外:这个语句是凌晨执行的,我不能手动在凌晨执行alter table。我都是用crontab中调用shell脚本执行的alter操作。这个内存怎么监控呢?
      

  4.   

    Red Hat Enterprise Linux Server release 5.3 (Tikanga)
    Linux db10-001 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
                 total       used       free     shared    buffers     cached
    Mem:         32177      30325       1851          0        247       9537
    -/+ buffers/cache:      20541      11635
    Swap:        16002          0      16002
      

  5.   

    while true 
    do
    echo `free`
    sleep 1
    done两个窗口  一个窗口执行alter语句  一个窗口执行上面的循环 
    另外查看dmesg  看看是否有out of memory的报错