I have a big snapshot database size is about 44GB in mydata.sql
. When I run it overnight, it show this error message:
$ mysql -u root < mydata.sql ERROR 1166 (42000) at line 65203: Incorrect column name ''
MySQL Version is 5.5.32-0ubuntu0.13.04.1
and this is a head from SQL file:
$ head -n 10 mydata.sql -- MySQL dump 10.13 Distrib 5.5.22, for Linux (x86_64) -- -- Host: localhost Database: -- ------------------------------------------------------ -- Server version 5.5.22-55-log
This is a snapshot of the line that making an issue:
$ sed -n '65200,65203p' < mydata.sql /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */
Line below 65203:
/*!50013 DEFINER=`mysql`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v_payments` AS select concat(`paypal_payments`.`id`,1) AS `id`, ***SNIP**** ,concat(`paypal_payments`.`payer_firstname`,' ',`paypal_payments`.`payer_lastname`,' ',`paypal_payments`.`payer_email`) AS `customer` ***SNIP*** from `paypal_payments` union select concat(`payment_data`.`id`,2) AS `CONCAT(id,2)`,`payment_data`.`id` AS `id`,`payment_data`.`txndate` AS `txndate`,`payment_data`.`valuedate` AS `valuedate`,concat('DBS - ',`payment_data`.`category`) AS `CONCAT('T - ',category)`,(`payment_data`.`credit` - `payment_data`.`debit`) AS `credit-debit` ***SNIP*** ,NULL AS `NULL`,NULL AS `NULL`,NULL AS `NULL`,`payment_data`.`note` AS `note`,`payment_data`.`remaining` AS `remaining` from `payment_data` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */;
How can I resolve this issue?
mysqldump
actually generates an invalid and non-restorable view definition from a working view because of quirks in the way the view was originally defined.``
adjacent to each other. Please find all of such cases and un-snip the output in your question with the additional lines and let's see if we find what I expect. We can then fix this question to apply more broadly to the underlying issue.