美文网首页
2020-12-29 xtrabackup 实现读取mysql实

2020-12-29 xtrabackup 实现读取mysql实

作者: 5A风景区 | 来源:发表于2020-12-29 15:16 被阅读0次

    在xtrabackup工具实现数据备份的过程中,有这样的行为,工具通过handle_option函数处理传入的参数并通过以下这段代码处理mysql实例相关的参数

      /* Reset u_max_value for all options, as we don't want the
      --maximum-... modifier to set the actual option values */
      for (my_option *optp = xb_server_options; optp->name; optp++) {
        optp->u_max_value = (G_PTR *)&global_max_value;
      }
    

    其中xb_server_options,是保存待识别的mysql参数信息的列表,

    struct my_option xb_server_options[]
    

    共包含datadir,tmpdir等相关参数,46项,其中最后一项为空值,为的是使for 循环结束.
    如果传给xtrabackup的参数有包含在这45项之中的,会打印在标准输出上,以做提示,具体实现是以下代码,

      if (!param_str.str().empty()) {
        msg("xtrabackup: recognized server arguments: %s\n",
            param_str.str().c_str());
        param_str.str("");
        param_str.clear();
      }
    

    相关文章

      网友评论

          本文标题:2020-12-29 xtrabackup 实现读取mysql实

          本文链接:https://www.haomeiwen.com/subject/yigfoktx.html