昨天,线上发生一例(HY000): Cannot modify @@session.sql_log_bin inside a transaction代码缺少显示的start transaction控制..…
测试库一条update语句报错:ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction mysql> UPDATE profitloss_collect_form SET ApproveStatus = 2    -> WHERE formcode = 'SY2015111803' AND (    ->     SELECT COUNT(8) FROM profitloss_collect_f…
在python脚本里执行: sql_gp1 = "VACUUM dwd_access_record_inout_temp" sql_gp2 = "delete from dwd_access_record_inout_temp t where t.indate > (select now()::timestamp-interval '36 hour')" conn = gputil.connect(logger,target_host,target_user,…
一.问题描述: 同事反馈线上一个表有其中一条数据无法删除,其他都正常,我拿到删数据的sql,尝试执行,报错如下: mysql> delete from facebook_posts where id = 7048962; ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction   二.问题处理 从报错信息看,应该是关于这条数据有事物未提交,锁等待超时了,下面我们就开始验证并解决问题 1.在sql执行期间…
转自:https://blog.csdn.net/mchdba/article/details/38313881 前言:朋友咨询我说执行简单的update语句失效,症状如下:mysql> update order_info  set province_id=15  ,city_id= 1667  where order_from=10 and order_out_sn='1407261241xxxx';ERROR 1205 (HY000): Lock wait timeout exceeded;…
在编写realm数据库相关时: 代码: List<Student> delByStudent(String priNum){ RealmResults<Student> studentsList = myStudentRealm.where(Student.class).equalTo("num",priNum).findAll(); for (int i = 0;i<studentsList.size();i++) studentsList.delete…
昨晚添加完索引之后, 查询整表的时候抛出Lock wait timeout exceeded; try restarting transaction, 吓死小白的我, 为什么条件查询可以, 整表查不了, 老大说是不是我添加错了..., 后来找到解决办法, 原来是死锁了 查看数据库的隔离级别 select @@tx_isolation; 查mysql当前库进程(是否有wait之类的线程, 直接kill) show full processlist 对比线程中的情况,查看里面是否有正在锁定的事务线程…
mysql> show full processlist; #查看问题的线程!!!! 找到异常进程的ID 然后kill 掉: mysql> kill xxxxxxx; #xxxxxx是ID号 然后再次执行update执作,问题解决!!…
对于数据库的操作,经常需要暂时停止对bin-log日志的写入,那就需要这个命令:set sql_log_bin=on/off 参考:dev.mysql.com/doc/refman/5.5/en/set-sql-log-bin.html 13.4.1.3 SET sql_log_bin Syntax SET sql_log_bin = {0|1} The sql_log_bin variable controls whether logging to the binary log is done…
Q: MySQL supports running multiple mysqld on the same server. One of the ways is to use mysqld_multi. If the default MySQL server instance (as configured in the [mysqld] section in my.cnf) uses log-bin, it enables the binary log for all the other ins…