mysql file import with multiple lines of string

    I have 3 sql files migrated from sqlite3 dump. Unfortunately they have string values of multiple lines. So when I mysql -p dbname <- dbname.sql it returns syntax errors at specific lines. These lines may look like this (lines have been edited for masking):

    INSERT INTO `tbl` VALUES('15052','53663968185392','21:57:25','FALSE','53634933924616','79886','','','','','79886','rado','simple','');
    INSERT INTO `tbl` VALUES('15052','53663466948450','21:37:30','FALSE','53653949005223','62487','','','','','62487','Nopa','oh, i dunno:
    /|\   /()\
     /\      / \','');
    INSERT INTO `tbl` VALUES('15052','53663423259319','21:35:45','FALSE','53662542442479','28086','','','','','28086','ESOS','AHAHAHAHAHAHAHA  ','');

    How can I import these sql files and let mysql understand that if a string doesn’t end with single quote there’s another line below? I searched for some args for mysql but didn’t find any.

    I also tried to use and redo the migration, as it says the python script handles this multiple line trouble. However every time the console says “Killed”, I guess because of the temp file operation (the sqlite3 db files are over 100Gb). I changed tempfile.tempdir = "/home/username/sqlite_to_mysql/, hoping it can provide enough space for the temp file (6Tb free) but still the console returned “Killed”. I don’t know other ways to solve it before the sql file is created.

    Thanks a lot for any help!

    leoce Asked on August 16, 2015 in No Category.

    This question was posted in Stack Exchange

    Have you ever used django? Django dump and import feature is the easiest way ever to move from one database to another. However if you have never used django the learning curve will be too steep.

    on August 16, 2015.

    What is the exact error returned?

    on August 16, 2015.

    Thanks! @BurhanKhalid question updated with the error.

    on August 16, 2015.

    Thanks! @e4c5 I’ve never used django before.

    on August 16, 2015.
    Add Comment
  • 0 Answer(s)

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.