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

推荐订阅源

Google DeepMind News
Google DeepMind News
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
N
News and Events Feed by Topic
GbyAI
GbyAI
I
InfoQ
P
Privacy & Cybersecurity Law Blog
AWS News Blog
AWS News Blog
Cisco Talos Blog
Cisco Talos Blog
C
Check Point Blog
Recent Announcements
Recent Announcements
D
Darknet – Hacking Tools, Hacker News & Cyber Security
D
Docker
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Scott Helme
Scott Helme
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
C
CXSECURITY Database RSS Feed - CXSecurity.com
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
W
WeLiveSecurity
S
Securelist
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
www.infosecurity-magazine.com
www.infosecurity-magazine.com
K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Schneier on Security
Schneier on Security
Stack Overflow Blog
Stack Overflow Blog
S
Security Affairs
NISL@THU
NISL@THU
O
OpenAI News
Vercel News
Vercel News
C
Cyber Attacks, Cyber Crime and Cyber Security
Y
Y Combinator Blog
T
Tor Project blog
G
GRAHAM CLULEY
T
Tailwind CSS Blog
博客园 - Franky
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
V2EX - 技术
V2EX - 技术
H
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure

WishMeLz - Linux

目标域名在线测试 - WishMeLz NodeBB 搭建安装笔记 v4.x - WishMeLz puppeteer在Linux端 依赖库确实 libdrm.so.2,libnss3.so Linux 工具箱整理 - WishMeLz docker 镜像加速 - WishMeLz Certimate 使用教程 - WishMeLz ip自签名ssl证书 - WishMeLz PM2搭配nvm使用不同版本Node启动项目 - WishMeLz cors-anywhere Nodejs实现静态资源代理,使用ESA加速访问 - WishMeLz
shell脚本备份数据库 - WishMeLz
WishMeLz · 2026-06-01 · via WishMeLz - Linux
 #!/bin/bash

# 设置变量
BACKUP_DIR="/backsql"  # 本地备份目录
MYSQL_USER="user"  # MySQL 用户名
MYSQL_PASSWORD="5CYGfYhjEXE4STY"  # MySQL 密码
MYSQL_HOST="127.0.1"  # MySQL 服务器地址,如果是远程服务器,请修改为相应的IP地址
MYSQL_PORT="22619"  # MySQL 端口号
DATABASE_NAME="detabase"  # 要备份的数据库名称

# 备份文件名格式:数据库名_日期.sql
BACKUP_FILE="$BACKUP_DIR/$DATABASE_NAME_$(date +\%Y-\%m-\%d).sql"

# 创建备份目录(如果不存在)
mkdir -p "$BACKUP_DIR"

# 备份数据库
mysqldump -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" --set-gtid-purged=OFF  -p"$MYSQL_PASSWORD" "$DATABASE_NAME" > "$BACKUP_FILE"

# 检查备份是否成功
if [ $? -eq 0 ]; then
    echo "Database backup successful: $BACKUP_FILE"
else
    echo "Database backup failed!" >&2
fi

# 可选:删除超过7天的旧备份
find "$BACKUP_DIR" -type f -name "*.sql" -mtime +7 -exec rm {} \;

日志

mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-16.sql
----------------------------------------------------------------------------
★[2025-01-16 01:00:03] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-17.sql
----------------------------------------------------------------------------
★[2025-01-17 01:00:03] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-18.sql
----------------------------------------------------------------------------
★[2025-01-18 01:00:03] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-19.sql
----------------------------------------------------------------------------
★[2025-01-19 01:00:02] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-20.sql
----------------------------------------------------------------------------
★[2025-01-20 01:00:02] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-21.sql
----------------------------------------------------------------------------
★[2025-01-21 01:00:04] Successful
----------------------------------------------------------------------------
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Database backup successful: /app/backsql/2025-01-22.sql
----------------------------------------------------------------------------
★[2025-01-22 01:00:03] Successful
----------------------------------------------------------------------------

最后编辑时间为: January 22nd , 2025 at 09:45 am
本文由 Wish 创作,采用 知识共享署名 4.0 国际许可协议进行许可
可自由转载、引用,但需署名作者且注明文章出处

标签 : 无标签