100分求助,数据库连接问题

小灰狼 2016-01-28 12:37:22
在CentOS7上,装的 MySQL5.6.25
之前用过一段时间,现在发现有问题,应用程序无法访问数据库

后用 Putty 登录 CentOS,在命令行下访问我的数据库,初始连接成功,但是只要一切换到我的数据库,就说连接丢失,真是无语了

[root@localhost test]# mysql -uroot -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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 ChargeStation;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from tbUser;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 2
Current database: ChargeStation

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
ERROR:
Can't connect to the server

mysql> exit
Bye
[root@localhost test]#

...全文
214 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
小灰狼 2016-01-29
  • 打赏
  • 举报
回复
没有人吗? 自己顶一下
小灰狼 2016-01-29
  • 打赏
  • 举报
回复
没有人吗? 我把那个表的文件复制下来了,能够还原吗?
小灰狼 2016-01-28
  • 打赏
  • 举报
回复
引用 1 楼 yupeigu 的回复:
再次连接呢,是不是还是哪个错误。 你试试这个; 打开mysql配置文件my.ini(linux为my.cnf),添加或修改max_allowed_packet参数: # server max allewed packet max_allowed_packet=100M 另外,为了避免等待时间超时,可以将以下两个参数设置大点: interactive_timeout=28800000 wait_timeout=28800000
这些都设置过了,没有效果 今天中午连饭都没吃,呆在办公室里 发现线索,应该是一个表被损坏了。 用 putty 登录CentOS后,进其它的数据库是可以的,但就是进不了我的那个数据库。在Windows下用 Navicat 可以访问那个数据库,但只要一访问那个表就出错。 之前想通过navicat 或 sqldump 导出数据库都会失败,但是导出时如果避开那个表和有关的视图,就会成功 那是一个带分区的 InnoDB 表,按 CreatedDateTime 进行 Range 分区。现在别的数据都导出来了,并且恢复到新建的数据库中,但是那个表中的数据怎么整出来啊?
LongRui888 2016-01-28
  • 打赏
  • 举报
回复
再次连接呢,是不是还是哪个错误。 你试试这个; 打开mysql配置文件my.ini(linux为my.cnf),添加或修改max_allowed_packet参数: # server max allewed packet max_allowed_packet=100M 另外,为了避免等待时间超时,可以将以下两个参数设置大点: interactive_timeout=28800000 wait_timeout=28800000

56,912

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧