Linux background log MySQL error exception explanation (recommended) _linux

Source: Internet
Author: User
Tags socket

1, caused by:com.MySQL.jdbc.exceptions.jdbc4.CommunicationsException:

The last packet successfully received from the server is 56,201,339 milliseconds ago. The last packet sent successfully to the server is 56,201,339 milliseconds ago. is longer than the server configured value of ' Wait_timeout '. Your should consider either expiring and/or testing connection validity use in before your, application the increasing Er 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)
... More

Explain:

The last packet received from the server was successfully 56201339 milliseconds. The last packet sent a successful server for 56201339 milliseconds. Longer than the value of the server Configuration "Wait_timeout". You should consider the expiration and/or validity test connection before use in the application, increase the server to the client timeout configuration value, or use the connector/J Connection Property "AutoReConnect = True" to avoid this problem.

Linux Lower/ETC/MYSQL/MYSQL.CNF

MYSQL.CNF file

#
# The MySQL database server configuration file.
#
# 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 ' A list of available options and with
#--print-defaults to the which it would actually understand and use.
#
# for explanations
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html


# This is passed to all MySQL clients
# It has been reported that passwords should is 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's entries for some specific programs
# The following values assume your have at least 32M RAM


# This is 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
# localhost which are more compatible and are 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 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 the 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-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 is used as easy to replay backup logs or for replication.
# note:if You are setting up a replication slave. Debian about
# Other settings for 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 to this file!
# The files must end with '. Cnf ', and otherwise they ' ll be ignored.
#
!includedir/etc/mysql/conf.d/


Lower_case_table_names = 1

The above is a small series for everyone to bring the Linux background log mysql error exception explanation (recommended) All content, I hope that we support cloud Habitat Community ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.