1. 程式人生 > >mysql實際碰到問題匯總

mysql實際碰到問題匯總

tin mod with sel www gate sta timeout size

問題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

mysql實際碰到問題匯總