Home > Database > Mysql Tutorial > How to implement mysql batch file to continue execution after an error_MySQL

How to implement mysql batch file to continue execution after an error_MySQL

WBOY
Release: 2016-11-30 23:59:35
Original
1654 people have browsed it

When upgrading batch sql scripts, due to various non-standard writing and non-repeatable execution, we usually hope that the sql script will not be terminated after an error occurs, but the execution will be completed. Although these problems can be solved by writing repeatable mysql stored procedures such as add_column/drop_column, in many cases, the ready-made version will take a long time to transition, so this requirement is still necessary.

It’s actually very simple, just add the --force command line option, as follows:

mysql -uroot -ppassword - -force [db] < patch.sql

The above is the entire implementation method of mysql batch file continued execution after an error brought to you by the editor. I hope you will support it~

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template