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 develop and monitor the script of MySQL database

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

Share

Shulou(Shulou.com)06/01 Report--

Let's learn how to develop and monitor the script of MySQL database. I believe you will benefit a lot after reading it. The text is not very good. I hope that how to develop and monitor the script of MySQL database is what you want.

Operating system: CentOS release 6.8 (Final)

[root@Cacti chapter7] # vi mysql_method.sh

Echo method1-

If [`lsof-I tcp:3306 | wc-l`-gt 0] # determine the value by worrying about the port number

Then

Echo "MySQL is Running."

Else

Echo "MySQL is Stopped."

/ etc/init.d/mysqld start

Fi

Echo method2--

If [`netstat-lntup | grep mysqld | wc-l `- gt 0] # determine the value by filtering the process name

Then

Echo "MySQL is Running."

Else

Echo "MySQL is Stopped."

/ etc/init.d/mysqld start

Fi

Echo method3-

If [`ps-ef | grep-v grep | grep mysql | wc-l `- gt 0] # judge by the traditional way

Then

Echo "MySQL is Running."

Else

Echo "MySQL is Stopped."

/ etc/init.d/mysqld start

Fi

After reading the MySQL database script how to develop and monitor this article, many readers will want to know more about it. If you need more industry information, you can follow our industry information section.

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