/mysql-backups

SpringBoot集成MySQL数据备份

Primary LanguageJava

mysql-backups

使用 SpringBoot2.x 整合 MySQL 数据备份和简单邮件发送

快速开始

  1. 创建 backups 数据库
  2. 导入 src/main/resources/mysql_backups.sql
  3. 修改 application-dev.yml 配置
# MySQL配置
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/backups?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowPublicKeyRetrieval=true
    username: root
    password: root
    win-path: C:\\mysqlbackups\\
    linux-path: /mysql/backups/
  mail:
    username:
    password:
  1. 启动项目

  2. 打开接口测试地址:http://IP:PROD/swagger-ui/index.html

  3. 校验接口