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

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

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 国际许可协议进行许可
可自由转载、引用,但需署名作者且注明文章出处

标签 : 无标签