Mysql Command master-to-master 1. the select statement combines two string fields into one field: select concat (a, B) as c from tables 2. query by date group select DATE_FORMAT (created_at, '% Y-% m-% d % H') as t from tables group by t 3. mysql creates a user/adds a remote user/modifies the user password. First, enter the mysql command: mysql-uroot-proot-> create user username @ '2017. 168.39.% 'identified BY 'Password'; configure remote-> grant replication slave, replication client on *. * TO username @ '2017. 168.39.% 'identified BY 'Password'; modify Password-> update mysql. user set password = PASSWORD ('xxx') where user = 'username';-> flush privileges; 4. master-to-master: configure remote: grant replication slave, replication client on *. * TO username @ '2017. 168.39.% 'identified BY 'Password'; create a master:-> slave stop;-> change master to master_host = '2017. 168.0.2 ',-> master_user = 'backup',-> master_password = 'back',-> master_log_file = 'mysql-bin.20.01 ',-> master_log_pos = 106;-> slave Start;-> show slave status \ G 4. View server_id. Note that the server_id of the master-to-master servers cannot be the same and must be modified. -> Show variables like 'server _ id'; Modify server_id-> set global server_id = 10; 5. view the auto_increment_increment and auto_increment_offset values:-> show variables like 'Auto _ inc % '; 6. the auto_increment_offset value must be set to different master-to-master servers. For example: auto_increment_increment = 2 # auto_increment_offset = 1. For the second server: auto_increment_increment = 2 # It is the starting value auto_increment_offset = 2 7. mysql has the following 14 remote connection permissions: select, insert, update, delete, create, drop, index, alter, grant, references, reload, shutdown, process, and file.