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]#