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 错误异常的解释(推荐)全部内容了,希望大家多多支持我们~

(0)

相关推荐

  • MySql 5.7.14 服务没有报告任何错误的解决方法(推荐)

    参照网上MySql 5.6的安装步骤,安装MySql服务后,使用net start mysql命令启动服务时,报错: MySQL 服务正在启动 .MySQL 服务无法启动. 服务没有报告任何错误. 请键入 NET HELPMSG 3534 以获得更多的帮助. 经过查找,找到了解决方法. 方法和步骤如下所示: 1.从官网下载MySQL http://dev.mysql.com/downloads/mysql/ ZIP Archive版本:mysql-5.7.14-winx64 2.解压到想安装到的

  • Mysql 错误too many connections解决方案

    Mysql 错误提示too many connections,最近遇到这个错误,经过上网查资料解决了,这里记录下,帮助有需要的朋友, 解决方法是修改/etc/mysql/my.cnf,添加以下一行: set-variable = max_connections=500 或在启动命令中加上参数 max_connections=500 就是修改最大连接数,然后重启mysql.默认的连接数是100,太少了,所以容易出现如题错误. 以下是mysql.com网站的相关说明: If you get a To

  • MAC上Mysql忘记Root密码或权限错误的快速解决方案

    最近一段时间都在倒腾mantis发现总是连接mysql出错,就随手修改了root权限,导致登录不上了. 下面给大家分享还原root权限和更改root密码的最便捷方法. 1:装mysql workbench .可视化界面直接操作. 2:苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务 3:进入终端 输入: cd /usr/local/mysql/bin/ 回车后 登录管理员权限 sudo su 回车后输入以下命令来禁止mysql验证功能 ./mysqld_safe -

  • 在 本地计算机 无法启动mysql服务 错误1067:进程意外中止

    无论安装何版本的mysql,在管理工具的服务中启动mysql服务时都会在中途报错  内容为:在 本地计算机 无法启动mysql服务 错误1067:进程意外中止 经过多方求教,得解决方法如下 查找系统(后来验证应该为windows目录)目录下的my.ini文件,编辑内容(如果没有该文件,则新建一个),至少包含basedir,datadir这两个基本的配置.  [mysqld]  # set basedir to installation path, e.g., c:/mysql  # 设置为MYS

  • 关于MySql 10038错误的完美解决方法(三种)

    第一种方法: 第一步: 先看报错窗口 2003 can't connect to MySQL server on '127.0.0.1'(10038). 第二步: 原因是:远程3306端口未对外开放操作. 第三步: 首先远程连接服务器,点击"开始"--> "管理工具"-->"高级安全Windows防火墙". 第四步: 在打开的窗口中,左边选中"入站规则",右边点击"新建规则"来建立一个入站规则.

  • mysql服务无法启动报错误1067解决方法(mysql启动错误1067 )

    试了谷歌到的几种方法,都没有解决,然后突然想起在启动apache的时候,iis的端口占用情况(因为我的apache也使用了80端口),所以  打开命令行 netstat -aon|findstr "3306" 结果显示 默默的在内心深处骂了一句"靠", 果然是端口占用,然后,顺藤摸瓜 tasklist|findstr "416" 结果显示 不得不联想到,优酷的攻城狮们的mysql数据库绝对不是使用的默认3306端口,然后杀掉explorer.ex

  • mysql 发生系统错误1067的解决方法

    解决方法如下: 1.先删除mysql服务 控制面板->管理工具->服务,先停止mysql服务 开始->运行->输入cmd->sc delete mysql 服务删除 2.修改my.ini 如果没将其创建(以下设置可以参考http://hi.baidu.com/chuyanwu/blog/item/98142a2e7d448d564ec2262c.html一般这个设置都不会错误) [mysqld] # set basedir to your installation path

  • mysql 启动错误1067 问题及解决方法

    本文向码农们介绍mysql服务无法启动报错误1067解决方法. 试了谷歌到的几种方法,都没有解决,然后突然想起在启动apache的时候,iis的端口占用情况(因为我的apache也使用了80端口),所以  打开命令行 netstat -aon|findstr "3306" 结果显示 默默的在内心深处骂了一句"靠", 果然是端口占用,然后,顺藤摸瓜 tasklist|findstr "416" 结果显示 不得不联想到,优酷的攻城狮们的mysql数据

  • Mysql中错误使用SQL语句Groupby被兼容的情况

    首先创建数据库hncu,建立stud表格. 添加数据: create table stud( sno varchar(30) not null primary key, sname varchar(30) not null, age int, saddress varchar(30) ); INSERT INTO stud VALUES('1001','Tom',22,'湖南益阳'); INSERT INTO stud VALUES('1002','Jack',23,'益阳'); INSERT

  • MySQL 常见错误分析与解决方法

     一.Can't connect to MySQL server on 'localhost'(10061)? 翻译:不能连接到localhost 上的mysql?分析:这说明"localhost"计算机是存在的,但在这台机器上却没提供MySQL服务.?需要启动这台机器上的MySQL服务,如果机子负载太高没空相应请求也会产生这个错误.?解决:既然没有启动那就去启动这台机子的mysql.如果启动不成功,多数是因为你的my.ini配置的有问题.重新配置其即可.?如果觉得mysql负载异常,

随机推荐