Answer the question
In order to leave comments, you need to log in
Is there a way to import a DB with data errors resulting in syntax errors?
Good afternoon!
There is a DB, 900 megabytes and hundreds of thousands of lines. Export passes normally, but at import in other DB the heap of syntax errors falls out. The data in it is generally very crooked, therefore, all sorts of double quotes and other troubles occur.
Usually I went through the dump with pens and ruled everything there. It worked when the database weighed 10-20 megabytes. In this case, this is impossible, but you need to import the database. How to be?
I would be grateful for advice, thanks.
Answer the question
In order to leave comments, you need to log in
play with
fields-escaped-by
fields-optionally-enclosed-by
fields-enclosed-by
<?php
$sql=file_get_contents("dump.sql");
file_put_contents("new_dump.sql",htmlspecialchars($sql,ENT_QUOTES));
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question