MySQL報錯彙總

1、Every derived table must have its own alias
解釋:這句話的意思是每個派生出來的表必須有一個自己的別名。一般是在多表查詢或者子查詢的時候會出現這個錯誤,因爲在嵌套查詢中,子查詢的結果是作爲一個派生表給上一級進行查詢,所以子查詢的結果必須有一個別名。
解決:查詢語句由
SELECT * from
(
select e.account from employee e
UNION
SELECT u.account from ‘user’ u
UNION
SELECT a.account from agent a
)
變爲
SELECT * from
(
select e.account from employee e
UNION
SELECT u.account from ‘user’ u
UNION
SELECT a.account from agent a
)as total
如上所示,在子查詢的後面增加一句 as total,相當於給子查詢的結果集派生表取別名爲total,問題就解決了。

2、ERROR 1114 (HY000):TABLE xxx IS FULL
解釋:這裏的table is full指的不是內存表的空間限制,而是myisam或者aria引擎。
解決:
查看創建表格的日誌文件(表結構)
show create table xxx\G
show table status like ‘xxx’\G
更改表平均行長度與最大行數:
alter table xxx avg_row_length=2000;
alter table xxx max_rows=100000000000;
接着就可以繼續load data了。
PS:以後大家建立用來存放大量日誌類型的數據表時,應該下意識的加上max_row_size參數。

3、ERROR 1297 (HY000): Got temporary error 410 ‘REDO log files overloaded (decrease TimeBetweenLocalCheckpoints or increase
NoOfFragmentLogFiles)’ from NDBCLUSTER
解釋:在線添加節點後使用alter online table Billinfo reorganize partition;命令 將表數據在數據節點上重新分配時報錯:
解決:
調整管理節點上的config.ini配置文件裏[ndbd default]下的TimeBetweenLocalCheckpoints 值和 FragmentLogFileSize 值
TimeBetweenLocalCheckpoints 參數:
Default value = 20
Changed it to TimeBetweenLocalCheckpoints =6
Setting TimeBetweenLocalCheckpoints to 6 or less means that local checkpoints will be executed continuously without pause, independent of the cluster’s workload.
FragmentLogFileSize 參數:
Default value = 16M
Changed it to FragmentLogFileSize=256M
Setting this parameter allows you to control directly the size of the redo log files. This can be useful in situations when MySQL Cluster is operating under a high load and it is unable to close fragment log files quickly enough before attempting to open new ones. Increasing the size of the fragment log files gives the cluster more time before having to open each new fragment log file.

4、ERROR 1297 (HY000): Got temporary error 4010 ‘Node failure caused abort of transaction’ from NDBCLUSTER,
解釋:插入時數據節點強制關閉。
**解決:**MaxNoOfConcurrentTransactions和MaxNoOfConcurrentOperations參數

5、ERROR 1297 (HY000) at line 1872: Got temporary error 410 ‘REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or incre’ from NDBCLUSTER
**解決:**Modify / Add parameter TimeBetweenLocalCheckpoints in your config.ini.
Default value = 20
Changed it to TimeBetweenLocalCheckpoints =6
Setting TimeBetweenLocalCheckpoints to 6 or less means that local checkpoints will be executed continuously without pause, independent of the cluster’s workload.

**6、**error 2815: ‘File not found(Ndbd file system inconsistency error, please report a bug). Ndbd file system error, restart node initial’.
解決:增大config.ini文件中的NoOfFragmentLogFiles 和 RedoBuffer 參數

**7、**Status:Temporary error,restart node
Message:System error,node killed during node restart by other node (Internal error,programming error or missing error message, please report a bug)
Error:2303 Error data:Node 12 killed this node because GCp stop was detected
Error object:NDBCNTR (Line:273)Ox000006
解釋:這個問題是因爲undo日誌空間文件 用完了。
解決:增加 undo日誌空間文件 ,語法如下
alter logfile group lg_1 add undofile ‘undo_2.log’ initial_size 1024M engine ndbcluster;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章