N
N
Nikolay2018-02-15 18:36:55
MySQL
Nikolay, 2018-02-15 18:36:55

What's wrong with dumping MySql database?

Good day everyone.
I suddenly ran into a problem.
Site on wordpress.
Worth the Disqus comments plugin.
When installing the plugin in the database, the wp_commentmeta table was created.
Everything works.
I do base dump through the mysqldump console - the dump becomes.
But I can’t load it back through the console, I get an error

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

We look at what is there in the dump on line 53.
A table is created:
DROP TABLE IF EXISTS wp_commentmeta;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE wp_commentmeta (
meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
comment_id bigint(20) unsigned NOT NULL DEFAULT0’,
meta_key varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
meta_value longtext COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (meta_id),
KEY comment_id (comment_id),
KEY meta_key (meta_key(191)),
KEY disqus_dupecheck (meta_key,meta_value(11))
) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Line 53 is adding a key by two fields
KEY disqus_dupecheck (meta_key,meta_value(11))
. There are about 400 entries in the wp_commentmeta table, but the problem occurs even when there are 2 entries (I tried it on an old backup).
What does she not like and how was this table originally created with such a key?
Thank you!
PS: If you delete this line with handles, then the dump is filled normally, but the soul is somehow restless.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eugenyg, 2018-02-15
@eugenyg

Very similar to this https://bugs.mysql.com/bug.php?id=4541
1. try migrating to innodb
2. try migrating to innodb mysql > 5.5.14 with https://dev.mysql.com/ doc/refman/5.5/en/innodb-par...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question