To start and shut down MySQL under CentOS

Source: Internet
Author: User
Tags centos

The mainstream UNIX system now has two styles: System V and BSD, and they differ as follows:

Linux as a class Unix, there are also these two styles, where CentOS belongs to System V, this article mainly describes how to start and shut down MySQL under CentOS (that is, System V style), and briefly describe the BSD system.

MySQL startup mode

1) direct call to Mysqld. This is the least common way and is not recommended for use.

2 Run Mysql.server Script

The Mysql.server script starts the server by calling Mysqld_safe, which can be started or closed by parameter start and stop.

Mysql.server script in the MySQL installation directory in the Share/mysql directory, if the source is installed MySQL, you can find in the Support-files directory. If you want to use Mysql.server, you must copy it to the appropriate run-level directory, as follows:

CP Mysql.server/etc/init.d/mysqld

chmod 755/etc/init.d/mysqld

Once configured, you can use the following command to start and close the MySQL instance:

Service Mysqld Start/stop

/etc/init.d/mysqld Start/stop

Use the Chkconfig command to configure startup to start automatically:

Chkconfig--add mysqld

Chkconfig mysqld on

Run the following command to check for proper activation:

[Root@data data]# chkconfig--list mysqld

Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

MySQL shutdown mode

Mysqladmin-p-U root shutdown

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

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.