Lost connection to MySQL server during query error

suganthanatwork

Registered
Jan 25, 2018
1
0
1
Srl Lanka
cPanel Access Level
Root Administrator
HI All, This is Suganthan,
I am getting error what is this all about. Please help me on this. I have a VPS. and I am new to this .


Code:
//
Cpanel::Exception::Database::Error/(XID 958y6c) The system received an error from the “MySQL” database “mysql”: 2013 (Lost connection to MySQL server during query)  at /usr/local/cpanel/Cpanel/Exception/CORE.pm line 336.

                Cpanel::Exception::create("Database::Error", ARRAY(0x1847e20)) called at /usr/local/cpanel/Cpanel/Exception.pm line 46

                Cpanel::Exception::__ANON__(__CPANEL_HIDDEN__, ARRAY(0x1847e20)) called at /usr/local/cpanel/Cpanel/DBI.pm line 200

                Cpanel::DBI::_create_exception(Cpanel::DBI::Mysql::st=HASH(0x1847bf8), "DBD::mysql::st execute failed: Lost connection to MySQL serve"..., undef) called at /usr/local/cpanel/Cpanel/DBI.pm line 188

                Cpanel::DBI::_error_handler("DBD::mysql::st execute failed: Lost connection to MySQL serve"..., Cpanel::DBI::Mysql::st=HASH(0x1847bf8), undef) called at bin/update_db_cache.pl line 333

                Script::Update::DB::Cache::can_get_mysql_usage(HASH(0xfd1e00), HASH(0x10612a8), Cpanel::DB::Map::Collection::Index=HASH(0x1805020)) called at bin/update_db_cache.pl line 60

                Script::Update::DB::Cache::script("Script::Update::DB::Cache") called at bin/update_db_cache.pl line 35//
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

Do you notice any error messages in the MySQL error log (/var/lib/mysql/$hostname.err) when restarting MySQL?

Thank you.
 

dave321

Member
Apr 28, 2016
5
1
53
San Francisco
cPanel Access Level
Root Administrator
Have a similar issue. Have identified the database that is affected. Created a new database and imported mysql from backup. Website is working now.

Trouble is I can't delete the old database. Tried everything.
* Issued ssh commands to delete table. Delete database. Each time mySQL loses connection.
- Command:
mysql> DROP TABLE tableNameHere;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 32
Current database: databaseNameHere

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

* phpmyadmin. When selecting database the tables fail to load.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
ERROR 2006 (HY000): MySQL server has gone away
Do you notice any error messages in the MySQL error log (/var/lib/mysql/$hostname.err) when this happens?

Thank you.
 

dave321

Member
Apr 28, 2016
5
1
53
San Francisco
cPanel Access Level
Root Administrator
MySQL Error Log:
InnoDB: End of page dump

2018-01-31 08:30:08 7f3dc46d7700 InnoDB: uncompressed page, stored checksum in field1 3611825200, calculated checksums for field1: crc32 2153513901, innodb 275906502, none 3735928559, stored checksum in field2 1701165504, calculated checksums for field2: crc32 2153513901, innodb 1701165504, none 3735928559, page LSN 40 2723214147, low 4 bytes of LSN at page end 2723214147, page number (if stored to page already) 3, space id (if created with >= MySQL-4.1.1 and stored already) 27593

InnoDB: Page may be an update undo log page

InnoDB: Page may be an index page where index id is 69111

InnoDB: (index "PRIMARY" of table "databaseNameHere"."prefix_menu_types")

InnoDB: Database page corruption on disk or a failed

InnoDB: file read of page 3.

InnoDB: You may have to recover from a backup.

InnoDB: It is also possible that your operating

InnoDB: system has corrupted its own file cache

InnoDB: and rebooting your computer removes the

InnoDB: error.

InnoDB: If the corrupt page is an index page

InnoDB: you can also try to fix the corruption

InnoDB: by dumping, dropping, and reimporting

InnoDB: the corrupt table. You can use CHECK

InnoDB: TABLE to scan your table for corruption.

InnoDB: See also MySQL :: MySQL 5.6 Reference Manual :: 14.21.2 Forcing InnoDB Recovery

InnoDB: about forcing recovery.

InnoDB: Error: Unable to read tablespace 27593 page no 3 into the buffer pool after 100 attempts

InnoDB: The most probable cause of this error may be that the table has been corrupted.

InnoDB: You can try to fix this problem by using innodb_force_recovery.

InnoDB: Please see reference manual for more details.

InnoDB: Aborting...

2018-01-31 08:30:08 7f3dc46d7700 InnoDB: Assertion failure in thread 139903265240832 in file buf0buf.cc line 2740

InnoDB: We intentionally generate a memory trap.

InnoDB: Submit a detailed bug report to http://bugs.mysql.com.

InnoDB: If you get repeated assertion failures or crashes, even

InnoDB: immediately after the mysqld startup, there may be

InnoDB: corruption in the InnoDB tablespace. Please refer to

InnoDB: MySQL :: MySQL 5.6 Reference Manual :: 14.21.2 Forcing InnoDB Recovery

InnoDB: about forcing recovery.

16:30:08 UTC - mysqld got signal 6 ;
---

Just want to delete the database and nothing I do allows for that.
Thanks in advance.
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,

It appears the database was removed completely and part of it still remained in the InnoDB.. You may try executing innodb recovery on your server, or you can remove the database and database files manually from that location, create a similar database with same name and then restore the database from the backup on it. After the innodb is fixed, you can then remove it properly...
 

dave321

Member
Apr 28, 2016
5
1
53
San Francisco
cPanel Access Level
Root Administrator
Added this to my.cnf file:
innodb_force_recovery = 1

Stops all websites from working once added.

Followed instructions to:
USE dbname;
CREATE TABLE tablename_recovered LIKE tablename;
INSERT INTO tablename_recovered SELECT * FROM tablename;

Ran into a few MySQL errors. Not sure why.
The recovered table was created.
Tried to DROP tablename and couldn't in shell.
Went into phpmyadmin. Was now able to select the offending table.
Deleted offending table.

Using CPanel, deleted the database.

Thanks for your information.
- Dave