SHUTDOWN

MariaDB starting with 10.0.4

The SHUTDOWN command is a new feature in MariaDB 10.0.4

Syntax

SHUTDOWN [WAIT FOR ALL SLAVES]

Description

The SHUTDOWN command shuts the server down.

WAIT FOR ALL SLAVES

MariaDB starting with 10.4.4

If WAIT FOR ALL SLAVES is specified, the server completes the shutdown only after the last binlog has been sent to all connected slaves.

Required Permissions

One must have a SHUTDOWN privilege (see GRANT) to use this command. It is the same privilege one needs to use the mysqladmin shutdown command.

Example

The following example shows how to create an event which turns off the server at a certain time:

CREATE EVENT `test`.`shutd`
    ON SCHEDULE
        EVERY 1 DAY
        STARTS '2014-01-01 20:00:00'
    COMMENT 'Shutdown Maria when the office is closed'
DO BEGIN
    SHUTDOWN;
END;

Other Ways to Stop mysqld

You can use the mysqladmin shutdown command to take down mysqld cleanly.

You can also use the system kill command on Unix with signal SIGTERM (15)

kill -SIGTERM pid-of-mysqld-process

You can find the process number of the server process in the file that ends with .pid in your data directory.

The above is identical to mysqladmin shutdown.

On windows you should use:

NET STOP MySQL

See Also

Comments

Comments loading...