How to restart MySQL in Linux and Windows

Source: Internet
Author: User
Tags mysql commands
The correct method for restarting MySQL in Linux: 1. Use MySQLservicemysqldrestart2 installed in the rpm package, and use MySQLlinux installed in the source package to disable MySQL commands.

How to restart MySQL in Linux: 1. Use MySQLservice mysqld restart2 installed in the rpm package, and disable MySQL commands installed in the source package. // linux

The correct method to restart MySQL in Linux:

1. MySQL installed through the rpm package

Service mysqld restart

2. Install MySQL from the source code package

// Linux Command to disable MySQL

$ Mysql_dir/bin/mysqladmin-uroot-p shutdown

// Linux Command to start MySQL

$ Mysql_dir/bin/mysqld_safe &

Mysql_dir is the installation directory of MySQL, and mysqladmin and mysqld_safe are located in the bin directory of the installation directory of MySQL, which is easy to find.

3. If none of the above methods are valid, you can use the Force Command "killall mysql" to close MySQL. However, this method is not recommended, this brutal method forcibly terminates the MySQL database service and may cause table corruption.

Step or method: RedHat Linux (Fedora Core/Cent OS)

1. start:/etc/init. d/mysqld start

2. stop:/etc/init. d/mysqld stop

3. restart:/etc/init. d/mysqld restart

Debian/Ubuntu Linux


1. start:/etc/init. d/mysql start


2. stop:/etc/init. d/mysql stop


3. restart:/etc/init. d/mysql restart

Windows

1. Click Start> Run (shortcut: Win + R ).

2. Start: Enter net stop mysql

3. Stop: Enter net start mysql
Prompt * Redhat Linux also supports service command, start: # service mysqld start stop: # service mysqld stop restart: # service mysqld restart

* In Windows, you cannot directly restart (restart). You can only stop the instance and start it again.

MySQL start, stop, restart method:

I. Startup Mode

1. start with service: service mysqld start

2. Use the mysqld script to start:/etc/inint. d/mysqld start

3. Start with safe_mysqld: safe_mysqld &

Ii. Stop

1. Start with service: service mysqld stop

2. Use the mysqld script to start:/etc/inint. d/mysqld stop

3. mysqladmin shutdown

3. Restart

1. Start with service: service mysqld restart

2. Use the mysqld script to start:/etc/inint. d/mysqld restart

,

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.