服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|

服务器之家 - 服务器系统 - Linux - linux 后台日志 mysql 错误异常的解释

linux 后台日志 mysql 错误异常的解释

2021-11-18 16:20Linux教程网 Linux

下面小编就为大家带来一篇linux 后台日志 mysql 错误异常的解释(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

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

以上就是小编为大家带来的linux 后台日志 mysql 错误异常的解释(推荐)全部内容了,希望大家多多支持服务器之家~

延伸 · 阅读

精彩推荐
  • Linuxlinux usb不能识别解决方法

    linux usb不能识别解决方法

    今天在linux 下使用usb时,提示无法识别,me很是郁闷,经过在搜集过程中,找到了一些,可以解决此问题的草组方法,现在晒出来和大家分享一下,希望可...

    Linux教程网6542019-12-14
  • LinuxLinux桌面分辨率在哪如何修改桌面分辨率

    Linux桌面分辨率在哪如何修改桌面分辨率

    因各种原因而需要修改桌面分辨率,但突然就找不到修改Linux桌面分辨率的地方,下面与大家分享几种修改桌面分辨率方法 ...

    系统之家5782019-10-23
  • LinuxLinux 新手请进~8个 Date 命令使用示例

    Linux 新手请进~8个 Date 命令使用示例

    本教程简要介绍了如何使用 date 命令在 Linux 系统上显示和设置日期。希望对各位有帮助!...

    Linux学习3842021-09-15
  • Linuxlinux如何调节和维护内核详细介绍

    linux如何调节和维护内核详细介绍

    作为用户程序和系统硬件之间的接口,内核在确保Red Hat Enterprise Linux 应用到广泛到物理和虚拟硬件环境中发挥来重要作用 ...

    Linux教程网1902019-12-15
  • LinuxCentos、Redhat上安装Nessus安全扫描软件步骤详解

    Centos、Redhat上安装Nessus安全扫描软件步骤详解

    这篇文章主要介绍了Centos、Redhat上安装Nessus安全扫描软件步骤详解,本文共分7步讲解了nessus的安装过程,需要的朋友可以参考下 ...

    服务器之家4622019-09-27
  • Linuxlinux中mkdir命令使用详解

    linux中mkdir命令使用详解

    这篇文章主要详细介绍了linux中mkdir命令使用方法以及实例代码分享,十分的全面,有需要的小伙伴参考。...

    Linux教程网9452021-10-22
  • LinuxLinux中常用的压缩和解压缩命令汇总

    Linux中常用的压缩和解压缩命令汇总

    在Linux中压缩和解压缩是经常要用到的命令,由于linux中各种压缩文件类型较多,所以需要记住几个主要的压缩和解压缩命令 ...

    Linux命令大全3942019-11-21
  • Linux盘点Linux平台下的十佳IDE

    盘点Linux平台下的十佳IDE

    一个好的IDE能够帮助程序员更加高效地工作。为了提高程序员的效率,小编在这里为大家收集了Linux平台下十款最佳的IDE,希望能够为大家提供帮助,让我...

    脚本之家8262019-09-30