halt

Continue SQL query even on errors in MySQL workbench

泪湿孤枕 提交于 2019-11-27 14:15:49
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? try mysql --force < sample_data.sql Mysql help section says -f, --force Continue even if we get an sql error. You could also use INSERT IGNORE INSERT IGNORE INTO mytable (primaryKey, field1, field2) VALUES ('1', 1, 2), ('1', 3, 4), //will not be inserted ('2', 5, 6); //will be inserted Steve In MySQL Workbench, I

Continue SQL query even on errors in MySQL workbench

给你一囗甜甜゛ 提交于 2019-11-26 16:38:58
问题 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? 回答1: try mysql --force < sample_data.sql Mysql help section says -f, --force Continue even if we get an sql error. 回答2: You could also use INSERT IGNORE INSERT IGNORE INTO mytable (primaryKey, field1, field2)