Bug #81006 Add equivalent of client's --force to server's --init-file execution
Submitted: 8 Apr 2016 8:50 Modified: 8 Jun 2016 8:29
Reporter: Lars Tangvald Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S4 (Feature request)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[8 Apr 2016 8:50] Lars Tangvald
Description:
A useful function of the server's --init-file functionality is to use it for administrative commands without needing a valid login or to start and stop the server as separate steps;
By running SHUTDOWN as the last command in the script, the server will start, run the desired queries, and then shut down again. In Ubuntu we use this in the installation scripts for various things, since we may not have valid logins to existing servers.

The problem is that if any part of the script fails for whatever reason, execution will halt and the SHUTDOWN command will never be reached, causing the automated script to hang.

If it was possible through an sql mode or command line option to force execution of the whole script (or make the server shut down on an error) it would solve this issue.

How to repeat:
* Create an sql file with a command that will cause an error followed by SHUTDOWN
* Run mysqld --init-file with the file, and observe how the server never shuts down.