脚本已超时,如果您想完成导入,请重新提交相同的文件,然后导入将恢复

脚本已超时,如果您想完成导入,请重新提交相同的文件,然后导入将恢复

我在 mysql 中导入数据库时​​收到此错误,当我重新提交同一个文件时,我收到此错误

Error

SQL query:

-- -- Dumping data for table `adminnotification_inbox` -- INSERT INTO `adminnotification_inbox` (`notification_id`, `severity`, `date_added`, `title`, `description`, `url`, `is_read`, `is_remove`) VALUES (1, 4, '2008-07-25 05:24:17', 'Magento 1.1 Production Version Now Available', 'We are thrilled to announce the availability of the production release of Magento 1.1. Read more about the release in the Magento Blog.', 'http://www.magentocommerce.com/blog/comments/magento-11-is-here-1/', 0, 0), (2, 4, '2008-08-02 05:29:53', 'Updated iPhone Theme is now available', 'Updated iPhone theme for Magento 1.1 is now available on Magento Connect and for upgrade through your Magento Connect Manager.', 'http://www.magentocommerce.com/blog/comments/updated-iphone-theme-for-magento-11-is-now-available/', 0, 0), (3, 3, '2008-08-02 05:40:04', 'Magento version 1.1.2 is now available', 'Magento version 1.1.2 is now available for download and upgrade.', 'http://www.magentocommerce.com/blog/comments/mag[...]

MySQL said: Documentation
#1062 - Duplicate entry '1' for key 'PRIMARY'

我现在该怎么办?我已经使用了互联网上给出的增加时间的解决方案,但没有任何效果。我该如何修复此错误。

我的数据库大小只有 3 MB。我在 ubuntu 12.04 中使用 xampp 1.8.3。

答案1

您可能主要使用 LAMP(Linux Apache MySQL PHP) 而不是 XAMPP。使用 LAMP 时您也可能会遇到此问题。

在我的例子中(使用 Ubuntu 15.10),我使用位于以下位置的 php.ini 文件配置/设置了 post_max_size、upload_max_filesize、max_execution_time、max_input_time、memory_limit,以满足我的需求/etc/php5/apache2/php.ini

但我仍然面临这个问题。然后使用 config.default.php文件解决了这个问题,你可以在下面找到类似以下行的内容:

$cfg['ExecTimeLimit'] = 300;

实现

$cfg['ExecTimeLimit'] = 0;

笔记:您可以config.default.php通过终端(Ctrl+Alt+T)使用此命令找到文件,locate config.default.php可能的路径是/usr/share/phpmyadmin/libraries/config.default.php

希望这可以帮助。 :-)

答案2

让它放下,然后在 phpmyadmin config.inc.php 中,你可以将时间从 300 秒增加到无穷大

添加此行

$cfg['ExecTimeLimit'] = 0;

和:

php> php.ini

寻找:

post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

改成:

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M

答案3

发生这种情况的原因是,在您插入的表中,您定义的1列已经有一个现有的值(主键的值是唯一值)。IDPRIMARY KEY

尝试将列 ID 设置为AUTO_INCREMENT

我希望这能解决你的问题,我注意到你修复了 XAMPP 安装问题,请关闭这个未解决的问题在 ubuntu 软件中心找不到 Xampp

答案4

转到 xampp/phpMyAdmin/libraries/config.default.php 找到$cfg['ExecTimeLimit'] = 300;第 695 行并替换$cfg['ExecTimeLimit'] = 0;

相关内容