Chinaunix首页 | 论坛 | 博客
  • 博客访问: 214032
  • 博文数量: 73
  • 博客积分: 1879
  • 博客等级: 上尉
  • 技术积分: 920
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-22 15:57
文章分类

全部博文(73)

文章存档

2012年(3)

2011年(15)

2008年(55)

分类: Mysql/postgreSQL

2008-08-07 12:16:41

1. Last_Error: Error 'The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay' on query. Default database: 'cets'. Query: 'Insert Into Purchase_Trace(Trace_Date,Trace_ModifyDate, Trace_Status,PO_BillNo,Supplier_ID,SKU_ID,SKU_Title,SKU_LeadTime,SKU_TargetDays,SKU_SafeDays,substitute, SKU_Tracer,Trace_Flow,Inventory_Qty,Inventory_VirtualQty,Inventory_PurchaseQty,Inventory_MoveQty,Trace_CanSaleDays, Trace_OrderPlace  ,Purchase_Qty,Purchase_Price1,Purchase_Price2,Purchase_Date,Purchase_DeliveryDate  ,Trace_Remark,Trace_Man,b2boutstanding_qty,b2coutstanding_qty)  Select CurDate(),CurDate(), 'Submit','PO080721032',105,a.SKU_ID,SKU_Title,SKU_LeadTime,SKU_TargetDays,substitute,  SKU_SafeDays,a.SKU_Tracer,ifnull(SKUFlow,0), ifNull(Inventory_Qty,0) as Inventory_Qty,ifNull(Inventory_VirtualQty,0) as Inventory_VirtualQty, ifNull(Purchase_NoQty,0) as Purchase_NoQty, ifNull(Move_Qty,0)as Move_Qty, floor((ifNull(Inventory_VirtualQty,0)+ifNull(P
A:This is a server message you are getting and is a valid issue. By default, we dont' set a max join size on the server so it sounds like someone has set a max join size on yours. If a join returns more rows than max_join_size, the server is going to respond with this. You can either remove the limit on max_join_size or issue the SET BIG_SELECTS yourself.

2.主从复制中经常出现       Last_Error: Error 'Duplicate entry '30013' for key 1' on query. Default database: 'cets'. Query: 'Insert Into SKU_Supplier(SKU_ID,Supplier_ID,LastInPrice,LastInDate) Select x.SKU_ID,y.Supplier_ID,x.In_Price,'2008-7-25' From Stock_InDetail as x Left Join Stock_InMaster as y on x.In_BillNo=y.In_BillNo Where x.In_SureMan is NULL and x.In_BillNo='IS080725009' and Concat(x.SKU_ID,y.Supplier_ID) Not In (Select Concat(SKU_ID,Supplier_ID) From SKU_Supplier)'

在从服务器上停止主从复制,stop slave,然后键入set global sql_slave_skip_counter=1;
语句,重启主从复制,如果有多条语句出现同样的差误 ,重复上面的过程,直到不出现上述提示为止

3.一直正常的主从服务,今天突然出现1064错误,从服务器上的错误日志具体如下。
080924  5:11:05 [Note] Slave: connected to master 'slave_user@192.168.10.105:3306',replication resumed in log 'mysql-bin.001238' at position 241687
080924  5:11:25 [ERROR] Slave: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' on query. Default database: 'otrs'. Query: 'delete from article_attachment where article', Error_code: 1064
080924  5:11:25 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.001238' position 241567

需要说明,本来红色article位置的条件在主服务器上应为article_id=id号,可不知为什么到了从服务器止变成了乱码,所以从服务器当然无法执行删作命令了,知道了原因,解决问题当然就容易了,
1.我们要根据从服务器错误日志中的'mysql-bin.001238 at position 241687'的提示从主服务器上找出这个位置点的
sql语句并记住where 条件语句的字段名与值,
2.然后在从服务器上执行mysql -e "show slave status\G",根据Relay_Log_File:后的日志文件名用myqlbinlog 日志文件名 提取日志到一个指定文件中,
3.然后根据从服务器错误日志中position后的位置号搜寻匹配语句,将找到语句where条件字段与值部分更改为你前面在主服务器找到的相应值。
4.更改完成后在mysql shell中用source 文件名 方式导入更改后的sql语句。
5.最后执行set global sql_slave_skip_counter=1;再停止重启从服务器。


阅读(2506) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~