Continue SQL query even on errors in MySQL workbench

Steve picture Steve · Mar 20, 2011 · Viewed 73.7k times · Source

I'm using MySQL workbench to import a Joomla sample_data.sql file into my local database. I want it to continue importing, even if an error occurs, by skipping the line that caused the error.

Is there something I can prefix the SQL with to prevent the query from halting at any errors?

Answer

Zimbabao picture Zimbabao · Mar 20, 2011

try

mysql --force < sample_data.sql 

Mysql help section says

 -f, --force         Continue even if we get an sql error.