Fixing 1064 SQL Error Importing Database into Wampserver

╄→尐↘猪︶ㄣ 提交于 2019-12-11 12:17:00

问题


When importing my 636MB database into Wampserver I get the below error. What is interesting is that I have max execution time set to 5000 in (php.ini). I have also tried numerous import methods and compression types all with the same results: MySql Console, PhpMyAdmin Console, BigDump, zip, gzip and finally using config.inc.php to upload a specified directory. Thank you for all help, suggestions & advice.

Current Settings:

php.ini:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

config.inc.php:
// maximum execution time in seconds (0 for no limit)
$cfg['ExecTimeLimit'] = 0;

my.ini:
max_allowed_packet = 200M

MySQL said: 
1064 - Erreur de syntaxe près de '<br />
Fatal error:  Maximum execution time of 300 seconds exceeded in <b' Ã  la ligne 141

Error
SQL query: 

INSERT INTO `log_url_info` (`url_id`, `url`, `referer`) VALUES
(2287337, 'http://www.website12345.com/sendfriend/product/send/id/44894/', NULL),
(2287338, 'http://www.website12345.com/sendfriend/product/send/id/44894/', NULL),
(2287339, 'http://www.website12345.com/sendfriend/product/send/id/44894/', NULL),
(2287340, 'http://www.website12345.com/catalog/category/view/id/66', NULL),
(2287341, 'http://www.website12345.com/catalog/category/view/id/718?multi_select_color_filter=2040', NULL),
(2287342, 'http://www.website12345.com/catalog/category/view/id/879?price=1000-2000', NULL),
(2287343, 'http://www.website12345.com/catalog/category/view/id/152?

limit=15&manufacturer=351&mode=list&multi_select_finish_filter=2602&multi_select_material_filter=2060&price=-1000', NULL),
(2287344, 'http://www.website12345.com/sendfriend/product/send/id/30583/', NULL),
(2287345, 'http://www.website12345.com/catalog/category/view/id/673?multi_select_finish_filter=2025', NULL),
(2287346, 'ht[...]

回答1:


It appears you have some syntax errors on your SQL query try to check that first.

I have managed to import an 800mb Database using command line.

Try:

mysql -p -u username -h 127.0.0.1 database < database.sql

Let me know if it works.




回答2:


The max_execution_time for phpMyAdmin is now controlled by the alias definition that lives in

\wamp\alias\phpmyadmin.conf

WAMPServer 2.5 version

Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"

# to give access to phpmyadmin from outside 
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#

<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
    Require local
  </IfDefine>
  <IfDefine !APACHE24>
    Order Deny,Allow
      Deny from all
      Allow from localhost ::1 127.0.0.1
    </IfDefine>
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

Note the use of these 4 parameters

  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360

You may need to amend upload_max_filesize and max_execution_time

Amend where required then restart Apache

left click wampmanager -> Apache -> Service _Restart Service

Now PHP will pay attention to these new parameters when you are running phpMyAdmin.




回答3:


SOLVED! I had to truncate & optimize log tables and select "Disable foreign key checks" upon exporting. And the database imported! No other changes required.



来源:https://stackoverflow.com/questions/31408592/fixing-1064-sql-error-importing-database-into-wampserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!