Linux correct way to restart Mysql _mysql

Source: Internet
Author: User

Since it is MySQL installed from the source package, there is no red hat used in the system Servcie mysqld Restart this script
Had to be restarted manually.
Someone suggested Killall MySQL. This barbaric method is in fact no good, mandatory termination, if the damage caused by the table, the loss is enormous.
A secure restart method is recommended here
$mysql _dir/bin/mysqladmin-u root-p shutdown
$mysql _dir/bin/safe_mysqld &
Mysqladmin and Mysqld_safe are located in the MySQL installation directory in the bin directory, it is easy to find.


Restart the MySQL service under Windows

Start and stop the MySQL service for users who do not have MySQL graphics management end:
... \...\bin>net stop MySQL
... \...\bin>net start MySQL


How to start/stop/restart MySQL

Start, stop, restart MySQL is each has an independent host must hold the operation of the owners, the following for you to briefly introduce the operation method:

First, the way to start

1, use service to start: Service mysqld start
2. Start with mysqld script:/etc/inint.d/mysqld start
3. Use Safe_mysqld to start:safe_mysqld&

Second, stop

1, use service to start: Service mysqld stop
2. Start with mysqld script:/etc/inint.d/mysqld stop
3, mysqladmin shutdown

Third, restart
1, use service to start: Service mysqld restart
2. Start with mysqld script:/etc/inint.d/mysqld restart

For a long time did not restart the MySQL under Linux, it seems that the service ran too stable Oh, the recent machine died, restart after the MySQL service also have to restart, unexpectedly command forgot, had to Baidu, Google!

The following is from the Internet search, should be the most reliable, we try to use not!

Long time no toss server, early in the morning to debug the page, found/tmp directory space full, resulting in MySQL no way normal operation. So modified the my.cnf in the mysql.sock of the store path and php.ini in the relevant settings, this time need to restart MySQL, oh, a long time did not toss the server under Linux, exactly suddenly can't think how to restart the Linux operating system under the MySQL Service command: (

As a result, Baidu, Google, "linux restart MySQL command", the search results show that the previous few summary information has been found in the answer: The following Linux to restart the correct way to MySQL:

1, through the RPM package installed MySQL

Service mysqld Restart

2, from the source package installed MySQL

Linux shutdown mysql Command
$mysql _dir/bin/mysqladmin-uroot-p shutdown
Linux to start MySQL command
$mysql _dir/bin/mysqld_safe &

Where Mysql_dir is the MySQL installation directory, mysqladmin and mysqld_safe located in the MySQL installation directory in the bin directory, it is easy to find.

3, the above methods are invalid, you can forcibly command: "killall MySQL" to close MySQL, but do not recommend such a way, because this barbaric method will forcibly terminate the MySQL database service, may cause table damage ... So I weighed it for myself.

Summary: Indeed a long time did not toss the server, a lot of basic commands are almost forgotten ~~~~~~ old

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.