• 【mysql】做 mariadb 的备库无法启动


    mysql 5.7.25
    mariadb 10.3.15
    mariadb 做主库,mysql 做丛库,
    mysql 在启动的时候报错
    image

    uuid

    a、有关server_id的描述
    The server ID, used in replication to give each master and slave a unique identity. This variable is set
    by the --server-id option. For each server participating in replication, you should pick a
    positive integer in the range from 1 to 232– 1(2的32次方减1) to act as that server's ID.
    
    
    
    b、有关 server_uuid的描述
    Beginning with MySQL 5.6, the server generates a true UUID in addition to the --server-id
    supplied by the user. This is available as the global, read-only variable server_uuid(全局只读变量)
    
    When starting, the MySQL server automatically obtains a UUID as follows:
    a).  Attempt to read and use the UUID written in the file data_dir/auto.cnf (where data_dir is
    the server's data directory); exit on success.
    b). Otherwise, generate a new UUID and save it to this file, creating the file if necessary.
    The auto.cnf file has a format similar to that used for my.cnf or my.ini files. In MySQL 5.6,
    auto.cnf has only a single [auto] section containing a single server_uuid [1992] setting and
    value;  
    
    Important
    The auto.cnf file is automatically generated; you should not attempt to write
    or modify this file 
    
    Also beginning with MySQL 5.6, when using MySQL replication, masters and slaves know one
    another's UUIDs. The value of a slave's UUID can be seen in the output of SHOW SLAVE HOSTS. Once
    START SLAVE has been executed (but not before), the value of the master's UUID is available on the
    slave in the output of SHOW SLAVE STATUS.
    
    In MySQL 5.6.5 and later, a server's server_uuid is also used in GTIDs for transactions originating
    on that server. For more information, see Section 16.1.3, “Replication with Global Transaction
    
    大意就是从MySQL5.6开始,除了--server id之外,服务器还会生成一个真正的UUID
    由用户提供。这是作为全局只读变量serveru uuid提供的(全局只读变量)
    在启动时,MySQL服务器会自动获取UUID
    

    在 mysql 中查看是可以查到的 show variables like 'server_uuid';

    然鹅在 mariadb中是没有的,

    难办啊

    感谢 https://blog.csdn.net/qq_44895681/article/details/106574216 的解析

    如果是 mysql 之间做主从,如果是基于克隆主机做的操作的话可能冲突导致主从异常。
    所以在 mysql 备库配置的时候删除 auto.cnf 然后在做主从配置,

  • 相关阅读:
    【转】二叉树中两个节点的最近的公共父节点
    查找最小的k个元素
    字符串的排列
    php字符串操作
    Android手机app启动的时候第一个Activity必须是MainActivity吗
    ASP.NET网站前端页面的复制
    MySQL字段类型说明
    转:Zend Server Community Edition(CE) 安装手记
    数据库远程导入导出步骤
    转:两种转换mysql数据编码的方法latin1转utf8
  • 原文地址:https://www.cnblogs.com/cizao/p/14757747.html
Copyright © 2020-2023  润新知