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;

你可能感兴趣的:(mysql,报错)