---
title: "导入 binlog"
method: POST
path: "/mysql/flashback-binlog"
tags: ["mysql"]
---

# 导入 binlog

`POST /mysql/flashback-binlog`

通过 `mysqlbinlog --flashback xxx | mysql` 导入 binlog

## Request body

- DbmServicesMysqlDbToolsDbactuatorPkgComponentsMysqlRollbackFlashbackComp
  - `extend` DbmServicesMysqlDbToolsDbactuatorPkgComponentsMysqlRollbackFlashback
    - `binlog_dir` string — 当 binlog_dir 不为空，表示 binlog 已下载；当为空时，目前只从本地软连接
    - `binlog_files` string[] — binlog列表，如果不提供，则自动从本地查找符合时间范围的 binlog
    - `parse_concurrency` integer — 解析binlog并发度
    - `recover_opt` DbmServicesMysqlDbToolsDbactuatorPkgComponentsMysqlRollbackRecoverOpt, required
      - `databases` string[] — row event 解析指定 databases
      - `databases_ignore` string[] — row event 解析指定 忽略 databases
      - `filter_rows` string — 暂不支持行级闪回
      - `tables` string[] — row event 解析指定 tables
      - `tables_ignore` string[] — row event 解析指定 忽略 tables
    - `stop_time` string
    - `target_time` string, required — 闪回的目标时间点，对应 recover-binlog 的 start_time, 精确到秒。目标实例的时区
    - `tgt_instance` DbmServicesMysqlDbToolsDbactuatorPkgNativeInsObject, required
      - `charset` string — 连接字符集
      - `host` string — 当前实例的主机地址
      - `options` string — 其它选项
      - `port` integer — 当前实例的端口
      - `pwd` string — 连接当前实例的User Pwd
      - `socket` string — 连接socket
      - `user` string — 连接当前实例的User
    - `tools` object — 外部指定工具路径
    - `work_dir` string, required — binlog 解析所在目录，存放运行日志
    - `work_id` string
  - `general` DbmServicesMysqlDbToolsDbactuatorPkgComponentsGeneralParam
    - `runtime_account` DbmServicesMysqlDbToolsDbactuatorPkgComponentsRuntimeAccountParam
      - `admin_pwd` string — mysql admin 密码，环境变量 GENERAL_ACCOUNT_admin_pwd
      - `admin_user` string — mysql admin 账户，环境变量 GENERAL_ACCOUNT_admin_user
      - `backup_pwd` string — dbbackup pwd
      - `backup_user` string — dbbackup user
      - `monitor_access_all_pwd` string — mysql monitor@% 密码
      - `monitor_access_all_user` string — mysql monitor@%
      - `monitor_pwd` string — mysql monitor 密码，环境变量 GENERAL_ACCOUNT_monitor_pwd
      - `monitor_user` string — mysql monitor 账户，环境变量 GENERAL_ACCOUNT_monitor_user
      - `proxy_admin_pwd` string — proxy admin pwd
      - `proxy_admin_user` string — proxy admin user
      - `repl_pwd` string — repl pwd, 环境变量 GENERAL_ACCOUNT_repl_pwd
      - `repl_user` string — repl user, 环境变量 GENERAL_ACCOUNT_repl_user
      - `tdbctl_pwd` string
      - `tdbctl_user` string
      - `yw_pwd` string — yw pwd
      - `yw_user` string — yw user
    - `runtime_extend` DbmServicesMysqlDbToolsDbactuatorPkgComponentsRuntimeExtend
      - `mysql_sys_users` string[]

---

[API](https://skmtc.net/tencentblueking/apis/dbactuator-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/dbactuator-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/dbactuator-api/versions/dc22dd49fd50/schema)
