惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

轻语博客

QUX主题后台设置完整使用指南 QUX 主题内置短代码使用教程 WordPress 移除菜单代码中没必要的部分 什么是 LLMs.txt?它对SEO有用吗?WordPress 网站如何生成 LLMs.txt? QUX子主题模块化首页 Linux如何重启Redis?如何优化Redis性能? 2023奥维图源 免费谷歌地图 热门神器:ChatGPT在线,无需魔法开箱即用!最新接口高效稳定 WordPress 开发人员必备的 12 个工具 WP-China-Yes插件:将你的WordPress接入本土生态体系中 WordPress 6.2 引入 HTML API 修改HTML标签和属性
宝塔面板自动重启数据库服务的shell脚本代码
0 个人已赞 · 2023-06-04 · via 轻语博客

2023-06-04 分类:网站教程 阅读(2.12K) 评论(0) 扫描二维码 隐藏侧边

WordPress占用资源比较大,服务器偶尔会出现数据库停止运行的情况,下面是一个重启数据库shell脚本,添加到服务器的计划任务即可,每执行一次便会检查数据库进程是否运行,如发现停止运行则会重启数据库

前往计划任务 任务类型选择shell脚本  然后把下面内容复制到脚本内容,建议执行频次在5-10分钟比较好。

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ]
then
/etc/init.d/mysqld start
exit
fi

阅读全文