美文网首页
遇到的问题

遇到的问题

作者: WEIJAVA | 来源:发表于2019-05-24 10:41 被阅读0次

1.连接数问题

之前遇到过数据库的连接数满了,应该是配置的jdbc的数量太多,看看数据库配置,所支持的最大连接数多少


image.png
image.png
image.png

原因是sleep 会话太多,sleep是jdbc连接池 与mysql的空闲连接,一个会话会占一个连接,当时把mysql 的wait_timeout 参数设置100s,又引发出 Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. 这个问题,原因是,这个sleep 超时自动释放,但是代码里面刚好在释放前拿到这个空闲连接,导致sql执行的时候丢失链接 报错,所以解决方案是配置少的jdbc连接数

2.负载问题,删除进程sql

show PROCESSLIST

kill 33840929

select * from information_schema.processlist where user='jxmoney' and state = '' and time > 1000 order by time asc

select * from information_schema.processlist where user='jxmoney' and time > 50

select concat('KILL ',id,';') from information_schema.processlist where user='jxmoney' and time > 50

SELECT CONCAT('kill ',id,';') AS KillSQL FROM information_schema.PROCESSLIST WHERE info LIKE
'%Alert table%'

3.ASCII问题

手机号不对的问题
SELECT id,ASCII(user_account),length(user_account) c,u.user_account from back_user u where length(user_account) > 12

image.png

相关文章

  • 遇到的问题

    express 搭建脚手架 - 因为chroma网络设置开了代理导致无法显示页面。。。。。。。。 express...

  • 遇到的问题

    还需要学习的东西vue源码nodejshttp等网络知识typescript设计模式 还需要刷的题牛客网前端50题...

  • 遇到的问题

    Dom4J 使用Dom4J解析XML文件时,遇到&时,程序异常信息“Error on line 1 of docu...

  • 遇到的问题

    【报错】变量 is not callable 当出现报错 XXX is not callable的时候,很有可能是...

  • AS遇到的问题

    Q 一些jar包提示Failed to resolve: com.squareup.retrofit:retrof...

  • 遇到的问题

    1.列表页右侧进度条没有,原因是:设置了body的overflow:hidden,范围设置太广,导致整个页面的ov...

  • 遇到的问题

    appcode 不能真机运行 Error:Safe Area Layout Guide before iOS 9....

  • 遇到的问题

    自主学习在线上课 在线上课又分成了各种细类别,中教1v1,外交1v1,小班课4,小班课8,在枚举里面,慢慢淘汰旧的...

  • 遇到的问题

    1.网络数据使用token加密,当token失效时候,此时发出一个请求,由于网络慢,还未接受到后台返回token失...

  • 遇到的问题

    1.使用em布局使用rem布局更好 2.footer的自适应问题 3.函数表达式和函数声明 用函数声明创建的函数f...

网友评论

      本文标题:遇到的问题

      本文链接:https://www.haomeiwen.com/subject/igowzqtx.html