1

My database is 8GB

When I run the database backup bash script, there is the warning/failure. They have appeared since 1 month ago

Here are my warning/failure

mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `xxx` at row: 427348 

mysqldump: Couldn't execute 'SELECT engine, table_type FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name = 'xxx'': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1': MySQL server has gone away (2006) 
.....

mysqldump: Couldn't execute 'UNLOCK TABLES': MySQL server has gone away (2006)
mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)" when trying to connect
Bach Do
  • 11
  • 1

2 Answers2

1

The Error 2013: Lost connection to MySQL server and MySQL server has gone away (2006) errors always mean that the connection between the program and the database was broken unexpectedly. Usually this happens due to the connection being killed by something, server running out of memory or due to a bug that ends up crashing the server process.

To find out what actually caused this, inspect the server error logs which by default is /var/lib/mysql/hostname.err.

markusjm
  • 328
  • 1
  • 6
0

If the server is not restarting for some reason, adding --quick --single-transaction to mysqldump may help.

Halfgaar
  • 8,084
  • 6
  • 45
  • 86