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.

Most popular FAQs RSS

  1. I require an additional IPv4 address. What is Bytehouse's ... (87981 views)
  2. The Most Common Problems When Migrating Websites (66436 views)
  3. How do I create a 301 redirect? (55004 views)
  4. Can I Backup Exchange 2010 with My Online Backup ... (53169 views)
  5. Steps to Add Administrator User for Windows Server (48716 views)

Latest FAQs RSS

  1. Steps to set/customize log rotation from plesk (2016-07-25 07:15)
  2. Generate a self-signed SSL certificate - Nginx,CentOS (2016-07-07 02:31)
  3. Procedure re-register Volume Shadow Copy Service(VSS) in a Windows ... (2016-07-05 04:18)
  4. Steps to Install Mcrypt in Plesk (2016-07-01 17:11)
  5. How to Retrieve a Plesk Password in Linux and ... (2016-07-01 17:09)

Regular new KB articles

Check back from time to time for new articles, or if you have any suggestions please feel free to recommend

top