Importing to phpMyAdmin is returning: #1071 – Specified key was too long; max key length is 1000 bytes. What can I do to fix this?

huangapple go评论79阅读模式
英文:

Importing to phpMyAdmin is returning: #1071 - Specified key was too long; max key length is 1000 bytes. What can I do to fix this?

问题

我正在恢复我的WordPress网站的副本,所以我进入了phpMyAdmin并点击了导入,然后导入了我的SQL文件。大约一分钟后,我收到了一条通知:

"MySQL说:#1071 - 指定的键太长,最大键长度为1000字节"

我该怎么办才能修复这个问题?我不确定这是否有帮助,但我是通过我的GoDaddy账户访问phpMyAdmin的。

英文:

I am restoring a copy of my wordpress site so I went into phpMyAdmin and clicked import and then import my SQL file. After a minute or so of loading I get a notification:

"MySQL said: #1071 - Specified key was too long; max key length is 1000 bytes"

What can I do to fix this? I'm not sure if this helps but I accessed phpMyAdmin through my GoDaddy account.

答案1

得分: 1

打开文本编辑器并打开SQL文件。查找并替换所有出现的"utf8"为"utf8mb4",因为这个字符集允许更长的键长度。保存更改,然后将修改后的SQL文件导入到phpMyAdmin中。

这可能对你有帮助。

英文:

Try This

Open the SQL file with a text editor. Find and replace all occurrences of "utf8" with "utf8mb4" as this character set allows longer key lengths. Save the changes and then import the modified SQL file back into phpMyAdmin.

This might Help You.

答案2

得分: 0

确保您将SQL导入到与WordPress相同版本的数据库中,正如nbk所说。不同版本的WordPress可能会导致数据库列长度存在差异。

英文:

As nbk said, make sure that you are importing the sql into the same version of wordpress. There may be differences in the column length of the database columns between different wordpress releases.

huangapple
  • 本文由 发表于 2023年7月27日 21:25:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76780227.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定