Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying MyCAT Read/Write Splitting

Create a test database and a test table.

  1. Connect to the MySQL database.
    1
    /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqlm.sock
    
  2. Create a test database and a test 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 the secondary database.
    1
    2
    3
    4
    /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls.sock
    show databases;
    use sysbench;
    show tables;