Blog - comments

I wish someone would demonstrate how they generated the graphs - seems to be a well-kept secret

tim carroll
Thank you for the very informative post. I've been researching why our DB generates so much redo at...
Gary F.

Hi Arnaud,

Can I hav english version of these document.

Rgds

Raffi

Mohammed Raffi
You may check also Valentina Studio 5.x: http://www.valentina-db.com/valentina-studio-overviewit ...
ahmad
Thanks a lot Pierre. This covers everything that would be necessary to upgrade the Enterprise Manage...
Seth with Firebox
Blog Gregory Steulet "MySQL server has gone away" ?!

dbi services Blog

Welcome to the dbi services Blog! This blog focuses on IT infrastructure - featuring news, troubleshooting, and tips & tricks. It covers database, middleware, and OS technologies such as Oracle, Microsoft SQL Server, Documentum, MySQL, PostgreSQL, Sybase, Unix/Linux, etc. The dbi services blog represents the view of our consultants, not necessarily that of dbi services. Feel free to comment on the postings!

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that has been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.

"MySQL server has gone away" ?!

A few days ago, I was at a customer that encountered some problems trying to restore his MySQL database. Indeed he got the following error message trying to restore his xwiki database:

mysql@dba-ecm-srv11:/ [mysqld1] mq < /MyBackupFile.sql
ERROR 2006 (HY000) at line 283: MySQL server has gone away

After having a look on the backup file I saw a quite big insert statement which looks like a BLOB:

 

Query INSERT INTO `xwikiattachment_archive` VALUES (-2136668642,''),(-2096787253,''),(-2085055696,'head    1.1;\naccess;\nsymbols;\nlocks; strict;\ncomment     @# @;\n\n\n1.1\ndate    2012.05.02.14.36.20;    author xwiki;   state Exp;\nbranches;\nnext ;\n\n\ndesc\n@@\n\n\n1.1\nlog\\n@\ntext\n@\n\nRPO-RTO-schema.jpg\n72278\nXWiki.n1.1\n/9j/4AAQSkZJRgABAQEASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABgEGAAMAAAABAAIAAAESAAMA\nAAABAAEAAAEaAAUAAAABAAAAV gEbAAUAAAABAAAAXgEoAAMAAAABAAIAAIdpAAQAAAABAAAAZgAA\nAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAr6gAwAEAAAA AQAAAfMAAAAA/9sAQwACAgIC\nAgECAgICAgICAwMGBAMDAwMHBQUEBggHCAgIBwgICQoNCwkJDAoICAsPCwwNDg4ODgkLEBEPDhEN\nD g4O/9sAQwECAgIDAwMGBAQGDgkICQ4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4O\nDg4ODg4ODg4ODg4ODg4O/8AAEQgB 8wK+AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAAB\nAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITF BBhNRYQcicRQygZGhCCNC\nscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN\ndXZ3e Hl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY\n2drh4uPk5ebn6Onq8fLz9PX29/j5+v/E AB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//E\nALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaG xwQkjM1LwFWJy0QoW\nJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWG\nh4iJipKT lJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp\n6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A/fy ...

 

The problem was coming from the maximum size of one packet which is managed by the parameter max_allowed_packet. This parameter default value is 1048576.

The reason why this value is by default rather small is to catch possibly incorrect packet as described in the official documentation - http://dev.mysql.com/doc/refman//5.5/en/server-system-variables.html#sysvar_max_allowed_packet - which is not a bad thing. However as soon as we have an application using BLOB, this value is often too small. In order to setup this parameter correctly for BLOB usage, you have to set this parameter to the size of the bigget BLOB. The maximum size is however limited to 1GB.

In the context of my customer setting the pararameter max_allowed_packet to 16M in the my.cnf or my.ini solved the issue.

Hope this will help you !

Tagged in: MySQL Troubleshooting
Rate this blog entry:
1

Gregory Steulet is Senior Consultant and Delivery Manager at dbi services. He is specialized in MySQL, Oracle technologies and security solutions (Oracle Database Vault). His expertise also includes open source solutions such as Data Replication Block Device (DRBD) Gregory Steulet is „Oracle Certified Professional“, „ MySQL Cluster 5.1 Certified Professional “, and „Avaloq Certified Professional“.

Comments

  • No comments made yet. Be the first to submit a comment

Leave your comment

Guest Wednesday, 22 May 2013
AddThis Social Bookmark Button