Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying MySQL Router Read/Write Splitting

  1. Create a test database and a test table.
    1. Connect to the MySQL database.
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqlm.sock
    2. Create a test database and table.
      1
      2
      3
      4
      5
      6
      7
      create database sysbench;
      use sysbench;
      CREATE TABLE `test1` (
        `id` bigint(20) NOT NULL,
        `report_hostname` varchar(100) DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
      
    3. Confirm that data is synchronized to secondary database 1.
      1
      2
      3
      4
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls.sock
      show databases;
      use sysbench;
      show tables;
      

    4. Confirm that data is synchronized to secondary database 2.
      1
      2
      3
      4
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls2.sock
      show databases;
      use sysbench;
      show tables;