Rate This Document
Findability
Accuracy
Completeness
Readability

Starting MGR

Log in to the three MySQL databases and start MGR.

  1. Start the primary database of the MGR (3306 is used as the primary database in this document).
    1. Log in to the MySQL database.
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqlm.sock
    2. Set the permissions so that you can create an InnoDB cluster in the existing MGR by using MySQL Shell.
      GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;
      flush privileges;
    3. Start MGR.
      SET GLOBAL group_replication_bootstrap_group=ON;
      START GROUP_REPLICATION;
      SET GLOBAL group_replication_bootstrap_group=OFF;

      For MySQL 8.0.21 and later versions, replace START GROUP_REPLICATION; in the preceding command with START GROUP_REPLICATION USER='rpl_user', PASSWORD='123456';.

  2. Start the secondary databases of MGR. (3307 and 3308 are used as secondary databases in this document)
    1. Log in to the MySQL databases.
      1
      2
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls.sock
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls2.sock
      
    2. Run the following statement in the secondary databases of ports 3307 and 3308 to start MGR:
      START GROUP_REPLICATION;
    3. View the information about group members. You can view any member in the MGR group.
      SELECT * FROM performance_schema.replication_group_members;