linux 后台日志 mysql 错误异常的解释(推荐)_Linux

1、Caused by: com.MySQL.jdbc.exceptions.jdbc4.CommunicationsException:

The last packet successfully received from the server was 56,201,339 milliseconds ago.  The last packet sent successfully to the server was 56,201,339 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

at sun.reflect.GeneratedConstructorAccessor257.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3291)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1938)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2086)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2237)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
... 45 more

解释:

最后从服务器接收到数据包成功是56201339毫秒。最后一个数据包发送成功服务器56201339毫秒。长于服务器配置“wait_timeout”的价值。你应该考虑到期和/或有效性测试连接在应用程序中使用之前,增加服务器为客户机超时配置值,或使用连接器/ J连接属性“autoReconnect = true”来避免这个问题。

Linux 下/etc/mysql/mysql.cnf

mysql.cnf文件

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
wait_timeout=86400000
interactive_timeout=86400000

#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
bind-address = 0.0.0.0
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
max_connections        = 10000
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 14
max_binlog_size         = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

lower_case_table_names = 1

时间: 2024-11-08 21:51:52

linux 后台日志 mysql 错误异常的解释(推荐)_Linux的相关文章

Linux启动/停止/重启Mysql数据库的简单方法(推荐)_Linux

1.查看mysql版本 方法一:status; 方法二:select version(); 2.Mysql启动.停止.重启常用命令 a.启动方式1.使用 service 启动: [root@localhost /]# service mysqld start (5.0版本是mysqld) [root@szxdb etc]# service mysql start (5.5.7版本是mysql) 2.使用 mysqld 脚本启动: /etc/inint.d/mysqld start 3.使用 sa

让你的错误能留下痕迹....(错误日志mysql篇目)

mysql|错误 class.method     //建立错误日志    function error(){        $fp=@fopen("error.dat","a+");        $time=date("Y-m-d H:i:s");        $msg="{VisitedTime:$time}\t{VisiterIP:$_SERVER[REMOTE_ADDR]}\t{Errormsg:".mysql_e

linux系统下 tomcat进程无辜消失 日志无任何异常

问题描述 linux系统下,tomcat进程消失日志没有任何异常,只是tomcat进程没了,谁知道这是什么原因? 解决方案

MySQL错误日志总结

MySQL错误日志是记录MySQL 运行过程中较为严重的警告和错误信息,以及MySQL每次启动和关闭的详细信息.错误日志的命名通常为hostname.err.其中,hostname表示服务器主机名. The error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running.

如何使用图形化工具远程管理 Linux 上的 MySQL

如果你在一个远程的VPS上运行了MySQL服务器,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如phpMyAdmin或者Adminer可能会是你第一个想起的.这些基于web的管理工具需要一个正常运行的后端的web服务和PHP引擎.但是,如果你的VPS仅仅用来做数据库服务(例如,数据库与其它服务独立存放的分布式结构),为偶尔的数据库管理提供一整套的LAMP是浪费VPS资源的.更糟的是,LAMP所打开的HTTP端口可能会成为你VPS资源的安全漏洞. 作为一种选择,你可以使用在一台客

Mysql错误1366 - Incorrect integer value怎么解决?

  这篇文章主要介绍了Mysql错误1366 - Incorrect integer value解决方法,本文通过修改字段默认值解决,需要的朋友可以参考下 由于这个数据库服务器存放的数据库比较多且都是小数据库,所以最初的时候是运行在windows服务器上的.前一段时间由于机房服务器要做调整,于是我便在一个夜深人静的夜晚对数据库进行的迁移及前台应用程序进行了调整,调整结束后测试应用均可以正常访问后我便离去了. 周一刚上班就收到反馈:网站后台发布文章报如下错误: 代码如下: insert into

Linux下keepalived+mysql 实现高可用

Linux下keepalived+mysql实现高可用 首先在搭建前分析,想用keepalived实现mysql高可用,那么先的对keepalived+lvs跟mysql主主复制有所了解.因为mysql+keepalived架构是在keepalived+lvs跟mysql主主复制的基础上实现的lvs+keepalived跟mysql主主复制,在前面的博文中已经介绍过了这里不啰嗦了. lvs+keepalived链接:http://duyunlong.blog.51cto.com/1054716/

MySQL错误ERROR 2002 (HY000): Can't connect to local MySQL server through socket_Mysql

在安装好了MySQL之后,使用了新的配置文件后,MySQL服务器可以成功启动,但在登陆的时候出现了ERROR 2002 (HY000): Can't connect to local MySQL server through socket,即无法通过socket连接到mysql服务器,同时提供了socket文件的位置.下面是这个问题的描述与解决办法. 1.故障现象 复制代码 代码如下: [root@SZDB mysqldata]# mysql -uroot -p123456 Warning: U

Linux CentOS6.6系统中安装mysql源码包的方法_Linux

这里以CentOS6.6系统中安装MySQL的源码包,进行讲解. 1. mysql源码包的下载 mysql安装包的官方下载地址为:http://dev.mysql.com/downloads/mysql/5.6.html 打开该下载地址后,在 "Select Version:"处,选择要下载的mysql的版本,我选择的是5.6.34:在"Select Platform:"处,选择适用的操作系统类型,由于是下载源码包,故这里我们要选择Source Code. 之后,会