英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论