mysql-5.7.9 Shutdown Syntax Explanation

Source: Internet
Author: User
Tags mysql client

mysql-5.7.9 finally provides shutdown syntax :

Before you can turn off a MySQL database by using the KILL command, mysqladmin shutdown, service mysqld stop, and so on.

However, after mysql-5.7.9 MySQL finally provided the SQL interface shutdown syntax!

shutdown syntax under the SQL interface :

Grammar

shutdown -- This shutdown must have shutdown permission to execute successfully. 

An example of shutdown :

[[email protected] ansible]# MySQL-Uroot-h127.0.0.1  --log into MySQLWelcome toThe MySQL Monitor. CommandsEnd  with;or\g.your MySQL Connection ID is 3Server Version:5.7. --Enterprise-Commercial-Advanced-LogMySQL Enterprise Server-Advanced Edition (commercial) Copyright (c) -, ., Oracleand/orits affiliates. Allrights reserved. Oracle isA registered trademark ofOracle Corporationand/oritsaffiliates. Names may trademarks oftheir respectiveowners. Type'Help ;' or '\h'  forHelp. Type'\c'  toClear the Currentinput Statement.mysql> shutdown;--execute shutdown through the SQL interfaceQuery OK,0Rows Affected (0.00sec)--execute the system under MySQL client to execute the Linux command here's a PS to see if there's Mysqld on Linux.Mysql>System PS-Ef|grep mysqlroot5709   3403  0  -: +Pts/0    xx:xx:xxMysql-Uroot-h127.0.0.1Root5720   5709  0  -: -Pts/0    xx:xx:xxSh-C PS-Ef|grep mysqlroot5722   5720  0  -: -Pts/0    xx:xx:xxgrep MySQL--the results from PS show that the MySQL database is closed (mysqld This process is not available)

If you have insufficient permissions, you will see the following effect :

MySQL>shutdown1227 (42000ofshutdownfor This operation

because shutdown is an instance-level permission, the authorization statement is as follows :

MySQL>Grantshutdownon*. *  to [Email protected] ' localhost '  01 Warning (0.00  sec)--  Grant [email protected] ' LocalHost ' User shutdown permissions

----

Learning Communication

mysql-5.7.9 Shutdown Syntax Explanation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.