amoeba连接mysql--ERROR 2006 (HY000): MySQL server has gone away
amoeba下载地址:http://sourceforge.net/projects/amoeba/files
amoeba version:amoeba-mysql-binary-2.1.0-RC5.tar.gz
mysql version:5.5.20
OS:Oracle Linux Server release 5.7
java version: "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
amoeba 的安装和配置参考http://docs.hexnova.com/amoeba/index.html
安装和配置的过程比较简单,在此记录一个使用过程中遇到的问题:
[mysql@db01 ]$ mysql -uroot -pmysql -h192.168.0.18 -P8066
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11416420
Server version: 5.1.45-mysql-amoeba-proxy-2.1.0-RC5
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use test;
No connection. Trying to reconnect...
Connection id: 11416420
Current database: *** NONE ***
mysql> select * from t1;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 11416420
Current database: test
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 11416420
Current database: test
ERROR 2006 (HY000): MySQL server has gone away
amoeba日志中的错误:
2012-03-05 15:10:21,028 INFO net.ServerableConnectionManager - Amoeba Monitor Server listening on /192.168.0.18:8634.
java.util.NoSuchElementException: Could not create a validated object, cause: ValidateObject failed
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1191)
at com.meidusa.amoeba.net.poolable.GenericObjectPool.borrowObject(GenericObjectPool.java:381)
at com.meidusa.amoeba.mysql.handler.CommandMessageHandler.startSession(CommandMessageHandler.java:629)
at com.meidusa.amoeba.mysql.handler.MySqlCommandDispatcher.handleMessage(MySqlCommandDispatcher.java:123)
at com.meidusa.amoeba.mysql.net.MysqlClientConnection$2.run(MysqlClientConnection.java:291)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
查了一些资料,修改了以下三个参数,重启后依然没起作用。
http://dev.mysql.com/doc/refman/5.5/en/error-lost-connection.html
mysql>show variables like 'connect_timeout';
mysql>show variables like 'net_read_timeout';
mysql>show variables like 'max_allowed_packet';
仔细检查dbServers.xml配置后发现factoryConfig中
<property name="password">password</property>
默认是被注释掉的,注释取消后正常。
<factoryConfig class="com.meidusa.amoeba.mysql.net.MysqlServerConnectionFactory">
<property name="manager">${defaultManager}</property>
<property name="sendBufferSize">64</property>
<property name="receiveBufferSize">128</property>
<!-- mysql port -->
<property name="port">3306</property>
<!-- mysql schema -->
<property name="schema">test</property>
<!-- mysql user -->
<property name="user">root</property>
<!-- mysql password
<property name="password">password</property>
-->
</factoryConfig>
http://blog.csdn.net/lwei_998/article/details/7321880
amoeba连接mysql--ERROR 2006 (HY000): MySQL server has gone away的更多相关文章
- Python pandas ERROR 2006 (HY000): MySQL server has gone away
之前在做python pandas大数据分析的时候,在将分析后的数据存入mysql的时候报ERROR 2006 (HY000): MySQL server has gone away 原因分析:在对百 ...
- 解决ERROR 2006 (HY000): MySQL server has gone away
刚把博客从百度云搬到腾讯云,发现文章少了几篇.当时在导入dump数据的时候,就曾经发现mysql提示: ERROR 2006 (HY000): MySQL server has gone away N ...
- MaxScale ERROR 2006 (HY000): MySQL server has gone away
Error: MaxScale cannot be run as root.Failed to write child process message!解决办法:# maxscale -f /etc/ ...
- mysql 使用shell时出现 ERROR 2006 (HY000): MySQL server has gone away 解决方法
ERROR (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection Current d ...
- MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题
参考:http://www.111cn.net/database/mysql/106911.htm 1.修改mysqld的配置文件my.cnf 调整max_allowed_packet的值,修改为5M ...
- mysql恢复和数据导入的问题(ERROR 2006 (HY000) at line 1016: MySQL server has gone away)
今天在上班过程中需要将一个1.3G的数据库sql文件导入到mysql数据库中去,在执行过程遇到了一些问题,执行到一半时报错,错误如下 ERROR 2006 (HY000) at line 1016: ...
- Linux MySQl 5.7.17 MySQL ERROR 1366(HY000):Incorrect string value 解决方法
MySQL ERROR 1366(HY000):Incorrect string value,在往数据库中插入中文的时候会出现. 这也就是编码问题,网上大部分都是说设置下配置文件中的设置,而可悲的是在 ...
- MySQL:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解决方法: 修改密码:alter user 'root'@'localhost' identified by '123456'; mysql> use mysql; ERROR 1820 (HY ...
- mysql - ERROR 1114 (HY000): The table is full
mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/73 ...
随机推荐
- JetSpeed2部署至Apusic操作步骤记录
JetSpeed2部署至Apusic操作步骤记录. 1.创建Apusic新域,配置端口.管理端口和管理密码. 2.将Tomcat/lib目录中的所有jar包复制至Apusic域中的lib目录中(包括数 ...
- Xcode7 使用AFNetWorking 报错 添加Security.framework
Undefined symbols for architecture x86_64: "_SecCertificateCopyData", referenced from: _AF ...
- pycharm的使用小技巧111
如果你想快速敲出if __name__ == '__main__':只需你敲个main 然后回车就ok了 import和from xx模块 import *的区别是前者使用时要加模块名加点,后者可以直 ...
- CentOS系统里如何正确取消或者延长屏幕保护自动锁屏功能(图文详解)
不多说,直接上干货! 对于我这里想说的是,分别从CentOS6.X 和 CentOS7.X来谈及. 1. 问题:默认启动屏幕保护 问题描述: CentOS系统在用户闲置一段时间(默认为5分钟)后, ...
- Hibernate配置(通过注解配置)
本文主要讲通过注解配置来替换Hibernate的映射文件 1.多对一配置 package com.jazz7.entity; import java.util.Date; import javax.p ...
- CCF|分蛋糕|Java
import java.util.Scanner; public class tyt { public static void main(String[] args) { Scanner in = n ...
- Spring data jpa中Query和@Query分别返回map结果集
引用: http://blog.csdn.net/yingxiake/article/details/51016234 http://blog.csdn.net/yingxiake/article/d ...
- Linux修改ssh端口,减少暴力破解
版本centos7 注意:操作时请勿断开当前的ssh连接,以免发生情况登陆不了. 1.修改的是 /etc/ssh/sshd_config 文件 打开文件之后会发现Port是注释掉的,默认为22 ...
- Node.js——express
res.send(),比原生的 res.end() 强大,原生只支持字符串和Buffer对象,而且需要自己加响应报文头,send支持字符串.Buffer.Json对象.数组,而且自动加响应报文头 ap ...
- vue框架的知识
基础:实例----组件----指令----选项-----计算属性----事件绑定----模板渲染-----内置动画 ---组件交互----路由. vuejs干了什么事情:数据渲染/数据同步 组件化/模 ...