blog/content/zh-cn/posts/sometimes-the-pagoda-panel-...

22 lines
393 B
Markdown
Raw Normal View History

2024-05-06 12:00:46 +08:00
---
title: "宝塔面板数据库有时候自动停止用计划任务来解决的办法"
2024-05-07 14:08:06 +08:00
slug: "bt-panel-database-automatically-task"
2024-05-06 12:00:46 +08:00
date: 2023-05-23T06:59:00.000Z
categories:
- 分享
tags:
- 宝塔
2024-05-08 16:41:18 +08:00
- mysql
2024-05-06 12:00:46 +08:00
---
创建计划任务,每分钟执行一次
脚本如下
```
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ];then
/etc/init.d/mysqld start
fi
```
检测数据库状态并自动启动