Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of restarting mysql under linux

Shulou Source: shulou.com Published: 2022-05-31 18:38:18 11月14日 Update

This article mainly explains "how to restart mysql under linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to restart mysql under linux".

The correct way to restart MySQL under Linux:

1. MySQL installed through the rpm package

Service mysqld restart

2. MySQL installed from the source package

/ / linux command to turn off MySQL

$mysql_dir/bin/mysqladmin-uroot-p shutdown

/ / linux command to start MySQL

$mysql_dir/bin/mysqld_safe &

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

3. When the above methods are not effective, you can disable MySQL by forcibly ordering "killall mysql", but this is not recommended, because this savage method will forcibly terminate the MySQL database service and may lead to table corruption.

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

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

two。 Stop: / etc/init.d/mysqld stop

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

Debian / Ubuntu Linux

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

two。 Stop: / etc/init.d/mysql stop

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

Windows

1. Click start-> run (shortcut key Win+R).

two。 Startup: enter net stop mysql

3. Stop: enter net start mysql

Note: * Redhat Linux also supports service command. Start: # service mysqld start stop: # service mysqld stop restart: # service mysqld restart

* you cannot directly restart (restart) under Windows. You can only stop it before starting it.

MySQL start, stop, restart methods:

I. start-up mode

1. Start with service: service mysqld start

2. Start with mysqld script: / etc/inint.d/mysqld start

3. Start with safe_mysqld: safe_mysqld&

2. Stop

1. Start with service: service mysqld stop

2. Start with mysqld script: / etc/inint.d/mysqld stop

3 、 mysqladmin shutdown

3. Restart

1. Start with service: service mysqld restart

2. Start with mysqld script: / etc/inint.d/mysqld restart

At this point, I believe you have a deeper understanding of "the method of restarting mysql under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Methods commands directories scripts content methods learning input practical deeper savage interest can be passed practical practical suggestions keyboard shortcuts simple operation data database Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Docker Shulou Tech Info macOS Redmi