Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to restart MySQL in linux

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to restart MySQL in linux". The content in the article is simple and clear, easy to learn and understand. Please follow the editor's train of thought to study and learn "how to restart MySQL in linux".

MySQL is the most popular relational database management system, and MySQL is one of the best RDBMS applications in WEB applications. In this introduction, you will quickly grasp the method of restarting MySQL in linux and easily use MySQL database.

If you have modified my.cnf, you need to restart the MySQL service. How to restart MYSQL correctly, please see the following article

Because Mysql is installed from the source package, there is no servcie mysqld restart script commonly used by Red Hat in the system.

Had to restart manually

Someone suggested that Killall mysql. In fact, this barbaric method will not work. If it is forcibly terminated, if the watch is damaged, the loss will be huge.

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 bin directory of the Mysql installation directory and are easy to find.

Restart MySQL service under windows

For users who do not have the mysql graphical management side installed, start and stop the mysql service:

... \... \ bin > net stop mysql... \... \ bin > net start mysql

How to start / stop / restart MySQL

Starting, stopping and restarting MySQL is an operation that every webmaster with an independent host must hold. Here is a brief introduction to how to do it:

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

I haven't restarted mysql under linux for a long time. It seems that the service runs too stably. Recently, the machine died and the mysql service had to be restarted after restarting. Unexpectedly, the order was forgotten, so Baidu and google had no choice but to do so!

The following is from the Internet search, should be the most reliable, let's try to use it!

I haven't messed with the server for a long time. I opened the page to be debugged early in the morning and found that the space in the / tmp directory was full. As a result, MySQL could not run properly. So I modified the storage path of mysql.sock in my.cnf and the relevant settings in php.ini. At this time, I need to restart MySQL. Hehe, I haven't messed with the server under Linux for a long time, but I suddenly can't remember how to restart the MySQL service under Linux operating system: (

As a result, Baidu and google issued the "restart MySQL command under Linux". As soon as the search results show, the answer has been found in the previous summary information:) 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 close 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 close 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. So weigh it yourself and use it.

Thank you for your reading, the above is the content of "how to restart MySQL in linux". After the study of this article, I believe you have a deeper understanding of how to restart MySQL in linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report