Deploying MySQL Router Read/Write Splitting
- Create a test database and a test table.
- Connect to the MySQL database.
/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqlm.sock
- 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;
- 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;

- 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;

- Connect to the MySQL database.