Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue SQL query even on errors in MySQL workbench

Tags:

mysql

halt

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?

like image 837
Steve Avatar asked Mar 20 '11 02:03

Steve


People also ask

How do I see full errors in MySQL Workbench?

To cause MySQL Workbench to show error messages, I had to change a preference. From the Workbench menu, click "Edit" -> "Preferences..." Open the "SQL Queries" tab. Check "Confirm Data Changes".

How do I stop a running query in MySQL Workbench?

Run the following command: mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') FROM information_schema. processlist WHERE user <> 'system user'; This will kill all your MySQL queries.

How do I increase connection timeout in workbench?

Can I adjust the timeout? Yes, go to Preferences, SQL Editor, and adjust the DBMS connection read time out option that defaults to 600 seconds. This sets the maximum amount of time (in seconds) that a query can take before MySQL Workbench disconnects from the MySQL server.


1 Answers

try

mysql --force < sample_data.sql  

Mysql help section says

 -f, --force         Continue even if we get an sql error. 
like image 160
Zimbabao Avatar answered Oct 05 '22 10:10

Zimbabao