MySQL - SHUTDOWN Statement



MySQL SHUTDOWN Statement

The SHUTDOWN statement stops the MySQL server. To invoke this statement, you need the SHUTDOWN privilege.

SHUTDOWN;

After executing this statement if you try to run other MySQL commands, you will get an error as shown below −

show tables;
No connection. Trying to reconnect...
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
ERROR:
Can't connect to the server

If invoke this in windows system. Type services.msc in the start menu in the Services double click the MySQL service you will get a properties window. In it, if you verify the status, you can observe that the service is stopped.

SHUTDOWN Statement

You can start the MySQL server you need to press the start button (below the status).

mysql_statements_reference.htm
Advertisements