mysqlhalt

Continue SQL query even on errors in MySQL workbench


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?


Solution

  • In MySQL Workbench, I unticked the option under Query to "Stop Script Execution on Errors":

    enter image description here

    It looks like Zimbabao's answer will work also.


    In newer versions use 'Toggle whether execution of SQL script should continue after failed statements'

    Toggle whether execution of SQL script should continue after failed statements