MySQL 5.6 C API Developer Guide
int mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
Asks the database server to shut down. The connected user must
have the SHUTDOWN
privilege.
MySQL servers support only one type of shutdown;
shutdown_level
must be equal to
SHUTDOWN_DEFAULT
. Dynamically linked
executables that have been compiled with older versions of the
libmysqlclient
headers and call
mysql_shutdown()
must be used
with the old libmysqlclient
dynamic
library.
The shutdown process is described in The Server Shutdown Process.
Commands were executed in an improper order.
The MySQL server has gone away.
The connection to the server was lost during the query.
An unknown error occurred.