【0】最終要的還是查看錯誤日志定位問題啊
【1】InnoDB ::
【1.1】cannot find a free slot for an undo log
最近數據庫數據量及訪問頻率比較大的兩個表出現了the table xxx is full的問題,導致無法寫入數據。
查看mysql log發現錯誤:
InnoDB :: cannot find a free slot for an undo log
原因分析:由於innodb的任何操作都隱含有一個transaction,而出現問題的表由於數據量大操作頻繁導致同時有太多事務,以致出現這樣的錯誤。
解決辦法:增大配置文件里的參數innodb_log_file_size到1G 。
【1.2】write to file ./ibdata failed at offset 310 3214654123
由上圖可知,有2種可能。
(1)ibdata已經達到設置上限
(2)ibdata已經達到OS的文件系統的 大小上限,無法再申請空間擴展。
【2】the table is full
有時候項目好好的就報:數據庫操作錯誤,請聯系管理員,發現后台報這個
來說說解決mysql出現"the table is full"的問題:
mysql出現"the table is full"的問題,一般有兩個原因:
【2.1】MEMORY (HEAP) storage engine
You are using the MEMORY (HEAP) storage engine; in this case you need to increase the value of the max_heap_table_size system variable. See Section 5.1.3, “Server System Variables”.
ERROR 1114 (HY000) at line 1720: The table 'XXXX' is full
於是就修改Mysql的配置文件my.ini,在[mysqld]下添加/修改兩行:
tmp_table_size = 256M
max_heap_table_size = 256M
系統默認是16M,修改完后重啟mysql
【2.2】硬盤空間滿了,清理硬盤即可
不要被mysql的安裝目錄所欺騙, 最好親自去看看數據存放目錄是哪
在my.ini 搜索 datadir
看其指向的目錄 就是數據存放目錄
使用df -h 查看
我當時的解決方案是,將數據庫的磁盤清理了就好了;
我覺得還可以創建臨時表,設置表的size