0

I am trying to import sql file but it gives error

Error
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNoljcEKwjAQRPecr9gPaENSEsSIh1BiW0ybmlRBL0KxBy89WdC/d7XsYWaWfbMuxhANlhLLAr3r
DEosUG9YGmgNjLWfdPIGNddcyVws4zK/FsGl4kJxyc4pYkgZ2sp1Q4YXR5R/zssb23BrvLdECta3
1iARXIrHNErW1/3vNAtpbd7mci1WXK8487arDE4z+79HWCeBg4H0AAEi+QYq6OAOR/JX0hJqciXl
BHsQsPsCe+gxtQ==
----END CUT----
----BEGIN RAW----

ERROR: C1 C2 LEN: 1 2 57
STR: 

MySQL: 5.5.41-0ubuntu0.14.04.1
USR OS, AGENT, VER: Linux MOZILLA 5.0
PMA: 4.0.10deb1
PHP VER,OS: 5.5.9-1ubuntu4.5 Linux
LANG: en
SQL:     SET FOREIGN_KEY_CHECKS=0;

----END RAW----

SQL query:

SET FOREIGN_KEY_CHECKS=0;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 

My sql file is

SET FOREIGN_KEY_CHECKS=0; 
TRUNCATE `sales_flat_creditmemo`; 
TRUNCATE `sales_flat_creditmemo_comment`; 
TRUNCATE `sales_flat_creditmemo_grid`; 
TRUNCATE `sales_flat_creditmemo_item`; 
TRUNCATE `sales_flat_invoice`; 
TRUNCATE `sales_flat_invoice_comment`; 
TRUNCATE `sales_flat_invoice_grid`; 
TRUNCATE `sales_flat_invoice_item`; 
TRUNCATE `sales_flat_order`; 
TRUNCATE `sales_flat_order_address`; 
TRUNCATE `sales_flat_order_grid`; 
TRUNCATE `sales_flat_order_item`; 
TRUNCATE `sales_flat_order_payment`; 
TRUNCATE `sales_flat_order_status_history`; 
TRUNCATE `sales_flat_quote`; 
TRUNCATE `sales_flat_quote_address`; 
TRUNCATE `sales_flat_quote_address_item`; 
TRUNCATE `sales_flat_quote_item`; 
TRUNCATE `sales_flat_quote_item_option`; 
TRUNCATE `sales_flat_quote_payment`; 
TRUNCATE `sales_flat_quote_shipping_rate`; 
TRUNCATE `sales_flat_shipment`; 
TRUNCATE `sales_flat_shipment_comment`; 
TRUNCATE `sales_flat_shipment_grid`; 
TRUNCATE `sales_flat_shipment_item`; 
TRUNCATE `sales_flat_shipment_track`; 
TRUNCATE `sales_invoiced_aggregated`; 
TRUNCATE `sales_invoiced_aggregated_order`; 
TRUNCATE `sales_payment_transaction`;
TRUNCATE `sales_order_aggregated_created`; 
TRUNCATE `sales_order_tax`;
TRUNCATE `sales_order_tax_item`;
TRUNCATE `sendfriend_log`; 
TRUNCATE `tag`; 
TRUNCATE `tag_relation`; 
TRUNCATE `tag_summary`; 
TRUNCATE `wishlist`; 
TRUNCATE `log_quote`; 
TRUNCATE `report_event`; 
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1; 
ALTER TABLE `sales_payment_transaction` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_tax_item` AUTO_INCREMENT=1; 
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1; 
ALTER TABLE `tag` AUTO_INCREMENT=1; 
ALTER TABLE `tag_relation` AUTO_INCREMENT=1; 
ALTER TABLE `tag_summary` AUTO_INCREMENT=1; 
ALTER TABLE `wishlist` AUTO_INCREMENT=1; 
ALTER TABLE `log_quote` AUTO_INCREMENT=1; 
ALTER TABLE `report_event` AUTO_INCREMENT=1; 
SET FOREIGN_KEY_CHECKS=1;

there is any way to solve this issue.

1

Try to remove the space on first line on your mysql

7
  • I have tried but error still remains. – Denish Vachhani Mar 16 '16 at 6:15
  • Try to set default charset to UTF8 – Asish Hira Mar 16 '16 at 6:23
  • i have tried but not solve issue. – Denish Vachhani Mar 16 '16 at 6:33
  • What is the command you gave for setting database charset?? – Asish Hira Mar 16 '16 at 6:40
  • i have using geany ui for set. – Denish Vachhani Mar 16 '16 at 6:42
1

Try to import your sql through mysql console. Its worked for me.

mysql -u root -p magento_test < /your/path/import.sql
4
  • i don't want to import using command. i want to from UI. there is no big file that issues that. so i want real solution for all time. +1 for your response. thanks buddy. – Denish Vachhani Mar 16 '16 at 6:22
  • Which utility you used for database import? – Jayesh Patel Mar 16 '16 at 6:23
  • phpmyadmin any suggetions? – Denish Vachhani Mar 16 '16 at 6:32
  • Is your import file successfully uploaded in phpmyadmin? – Jayesh Patel Mar 16 '16 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.