mysql实际碰到问题汇总

问题1:SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'muwms.middle_goods_trace.size' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
出现这种问题 直接修改my.cnf 即可
在mysqld下面添加sql_mode="" 然后保存 -》重启mysql 完活

问题2:ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
产生这个问题的原因是因为在mysql中产生了事务A,执行了修改的语句,比如: update t1 set aget=18 where id=1;此时事务并未进行提交,事务B开始运行,也同样需要修改id为1的用户的年龄: update t1 set aget=20 where id=1; 那么此时事务B会等待事务A结束释放写锁才能执行成功,否则则会等待一段时间。
解决方法:https://www.cnblogs.com/topicjie/p/7323248.html

猜你喜欢

转载自www.cnblogs.com/ryanlamp/p/10797666.html