Mysql backup restoration related errors


**************************************************************************************************************

Error

ERROR 2013 (HY000) at line 4027: Lost connection to MySQL server during query

 

Solution

Increase value of max_allowed_packet to as much as required. If the database is very big values as high 512M may be required

 

Example

===========================================

[mysqld]
max_allowed_packet=512M
===========================================

**************************************************************************************************************

Error

ERROR 1071 (42000) at line 4228: Specified key was too long; max key length is 1000 bytes

 

Solution

Edit dump file and change CHARSET from utf-8 to latin1 in the table affected in line 4228

 

Example

From:

===========================================

CREATE TABLE ´core_file_storage´ (
  ´file_id´ int(10) unsigned NOT NULL AUTO_INCREMENT,
  ´content´ longblob NOT NULL,
  ´upload_time´ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  ´filename´ varchar(255) NOT NULL DEFAULT '',
  ´directory_id´ int(10) unsigned DEFAULT NULL,
  ´directory´ varchar(255) DEFAULT NULL,
  PRIMARY KEY (´file_id´),
  UNIQUE KEY ´IDX_FILENAME´ (´filename´,´directory´),
  KEY ´directory_id´ (´directory_id´)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
===========================================

To:

===========================================

CREATE TABLE ´core_file_storage´ (
  ´file_id´ int(10) unsigned NOT NULL AUTO_INCREMENT,
  ´content´ longblob NOT NULL,
  ´upload_time´ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  ´filename´ varchar(255) NOT NULL DEFAULT '',
  ´directory_id´ int(10) unsigned DEFAULT NULL,
  ´directory´ varchar(255) DEFAULT NULL,
  PRIMARY KEY (´file_id´),
  UNIQUE KEY ´IDX_FILENAME´ (´filename´,´directory´),
  KEY ´directory_id´ (´directory_id´)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
===========================================

**************************************************************************************************************

 

Last update:
2015-07-16 12:06
Author:
Bytehouse Technical Support
Revision:
1.2
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags

top