美文网首页
MySQL启动

MySQL启动

作者: 轰天zs | 来源:发表于2018-03-23 14:15 被阅读0次

全程gdb调试

gdb /usr/local/mysql/bin/mysqld
b mysqld_main
run  --defaults-file=/data/jdb/mysql/my.cnf.3306 --user=mysql
  1. 开启binlog会检查server_id
  //If the binlog is enabled, one needs to provide a server-id
  if (opt_bin_log && !(server_id_supplied) )
  {
    sql_print_error("You have enabled the binary log, but you haven't provided "
                    "the mandatory server-id. Please refer to the proper "
                    "server start-up parameters documentation");
    unireg_abort(MYSQLD_ABORT_EXIT);
  }
  1. 检查data目录下是否有auto.cnf
  /*
    Each server should have one UUID. We will create it automatically, if it
    does not exist.
   */
  if (init_server_auto_options())
  {
    sql_print_error("Initialization of the server's UUID failed because it could"
                    " not be read from the auto.cnf file. If this is a new"
                    " server, the initialization failed because it was not"
                    " possible to generate a new UUID.");
    unireg_abort(MYSQLD_ABORT_EXIT);
  }
  1. 将uuid加入sid_map()中
  /*
    Add server_uuid to the sid_map.  This must be done after
    server_uuid has been initialized in init_server_auto_options and
    after the binary log (and sid_map file) has been initialized in
    init_server_components().

    No error message is needed: init_sid_map() prints a message.

    Strictly speaking, this is not currently needed when
    opt_bin_log==0, since the variables that gtid_state->init
    initializes are not currently used in that case.  But we call it
    regardless to avoid possible future bugs if gtid_state ever
    needs to do anything else.
  */
  global_sid_lock->wrlock();
  int gtid_ret= gtid_state->init();
  global_sid_lock->unlock();

  if (gtid_ret)
    unireg_abort(MYSQLD_ABORT_EXIT);
  1. 初始化gtid_state对象
  // Initialize executed_gtids from mysql.gtid_executed table.
  if (gtid_state->read_gtid_executed_from_table() == -1)

相关文章

  • Mac下HomeBrew安装和卸载Mysql

    安装Mysql 设置MySql开机启动 启动Mysql 停止Mysql(设置了开机启动) 停止Mysql(未设置开...

  • brew mysql启动

    启动 mysql, 并设置为开机启动 关闭 mysql 重启 mysql

  • 初涉MySQL

    启动/停止/重启MySQL服务 启动MySQL服务: mysql.server start 停止MySQL服务:...

  • CentOS 7 安装 MYSQL 5.6

    安装 MySQL 安裝 MySQL Repository 安裝 MySQL 套件 启动 MySQL 启动 mysq...

  • Mysql笔记

    MySQL的启动和关闭 启动MySQL服务 net start mysql 关闭MySQL服务 net sto...

  • 1.3MySQL数据库

    MySQL服务启动 命令提示符:net start mysql:启动mysql服务net stop mysql: ...

  • MySQL 常用的指令

    1.mysql 启动停止 mysql.server start 启动mysql.server stop ...

  • mysql 启动登录

    先确保mysql是启动的输入 net start mysql 启动mysql的服务 再登录 mysql -u ...

  • Mac 下mysql遇到的问题

    1.mysql服务没有启动 打开myql时出现异常,由于mysql服务没有启动 2.启动mysql报错 启动mys...

  • MySql 配置

    1.启动和关闭 MySQL Server 启动 MySQL Server 查看 MySQL Server 状态 关...

网友评论

      本文标题:MySQL启动

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