I am trying to export a very large data from mysql to .csv and import the .csv into another identical table using the
into outfile
in phpmyadmin. But when i look at the excel file it is messed up. It seems that mysql cant determine the longtext format so it goes to another line like this one:
So when i try to import this to an identical table, it is all messed up. Here's my import code to other table:
LOAD DATA INFILE 'final.csv'
INTO TABLE oldforum_nodewithusers
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'
By the way i manually typed the headers of the table since i dont know too how to put headers in the export code. Here's my export code:
SELECT 'some table columns'
into outfile 'final.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
So how to fix this? is it in the export part? or the import part?
I KNOW NOW THE PROBLEM, THEY TEXT THAT WENT TO THE NEXT LINE IN THE PICTURE HAS EXCEED THE TEXT LIMIT FOR A CELL IN EXCELL
so when i import it to another table the table will treat the "next lined" text as another row. Anyone has solution for this?