![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
kefe2
这个作者很懒,什么都没留下…
展开
-
MySQL 中 delete where in 语句的子查询限制
场景一delete from table1 where id = (select max(id) from table1 );[Err] 1093 - You can’t specify target table 'table1 ’ for update in FROM clause描述: 如果子查询的 from 子句和更新、删除对象使用同一张表,会出现上述错误。解决方法: 通过给...转载 2018-10-17 15:05:26 · 36308 阅读 · 7 评论 -
数据库cpu飙升,使用pt-kill工具记录慢sql,并杀死sql保障数据库不挂掉
最近一个项目交付特别严,在有一次压测过程中,突然之间数据库连接数变多,cpu利用率也一下子飙升到70%,万幸的是cpu立马降了,数据库没有挂掉。这时候我们可以使用pt-kill 记录所有慢sql,并且立即杀死进程。一.安装pt-kill 工具PT工具是使用Perl语言编写和执行的,所以需要系统中有Perl环境。依赖包检查命令为:rpm -qa perl-DBI perl-DBD-My...原创 2018-12-07 18:58:02 · 650 阅读 · 0 评论 -
mybatis if判断字符串
mybatis 使用if 判断字符串正例1:<if test="itemCode != null and itemCode !='' and itemCode !='aaa'.toString()">正例2:<if test='itemCode != null and itemCode !="" and itemCode !="aaa" '>反例:<...原创 2019-05-17 17:58:20 · 13768 阅读 · 3 评论