--Back up the specified sql data
--mysql -h127.0.0.1 -P7018 -utest -ptest -e "select distinct ct_task_id from tb_test where task_type = 1" cdc_dmap > cdc_dmap.txt
The solution for garbled characters, set the encoding: set names utf8;
--mysql -h127.0.0.1 -P7018 -utest -ptest -e "set names utf8;select distinct ct_task_id from tb_test where task_type = 1" cdc_dmap > cdc_dmap.txt