Some pratice
I wanna dump all the data before '2012-04-05 00:00:00' in tables feed_appended_[0000-1023].
1. feed_appended_[0000-1023] are distributed in databases feel_[00-31]
2. database feel_[00-31] are distributed in these hosts(16 hosts):{host0[85-99].idc1,host084.idc1}
So the sql will be :
mysqldump -u -p -h {host0[85-99].idc1,host084.idc1} --where=' modified < "2012-04-05 00:00:00" ' --single-transaction --skip-add-drop-table feel_[00-31] feed_appended_[0000-1023] > data.[0000-1023].sql
Documentation && Samples
CREATE TABLE user_info_[0000-0003] LIKE user_info_sample;
CREATE TABLE user_info_0000 LIKE user_info_sample;
CREATE TABLE user_info_0001 LIKE user_info_sample;
CREATE TABLE user_info_0002 LIKE user_info_sample;
CREATE TABLE user_info_0003 LIKE user_info_sample;
CREATE TABLE user_[00-01].user_info_[00-07] LIKE user_info_sample;
CREATE TABLE user_00.user_info_00 LIKE user_info_sample;
CREATE TABLE user_00.user_info_01 LIKE user_info_sample;
CREATE TABLE user_00.user_info_02 LIKE user_info_sample;
CREATE TABLE user_00.user_info_03 LIKE user_info_sample;
CREATE TABLE user_01.user_info_04 LIKE user_info_sample;
CREATE TABLE user_01.user_info_05 LIKE user_info_sample;
CREATE TABLE user_01.user_info_06 LIKE user_info_sample;
CREATE TABLE user_01.user_info_07 LIKE user_info_sample;
mysql -u -p -h {db_mysql_[0-3]} -e 'SELECT count(*) FROM uic_[00-03].users_[0000-0015]';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0000';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0001';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0002';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0003';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0004';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0005';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0006';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0007';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0008';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0009';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0010';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0011';
mysql -u -p -h db_mysql_3 -e 'SELECT count(*) FROM uic_03.users_0012';
mysql -u -p -h db_mysql_3 -e 'SELECT count(*) FROM uic_03.users_0013';
mysql -u -p -h db_mysql_3 -e 'SELECT count(*) FROM uic_03.users_0014';
mysql -u -p -h db_mysql_3 -e 'SELECT count(*) FROM uic_03.users_0015';
mysql -u -p -h {db_mysql_[0-2],db_other_00} -e 'SELECT count(*) FROM uic_[00-03].users_[0000-0031]';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0000';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0001';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0002';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0003';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0004';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0005';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0006';
mysql -u -p -h db_mysql_0 -e 'SELECT count(*) FROM uic_00.users_0007';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0008';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0009';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0010';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0011';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0012';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0013';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0014';
mysql -u -p -h db_mysql_1 -e 'SELECT count(*) FROM uic_01.users_0015';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0016';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0017';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0018';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0019';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0020';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0021';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0022';
mysql -u -p -h db_mysql_2 -e 'SELECT count(*) FROM uic_02.users_0023';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0024';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0025';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0026';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0027';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0028';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0029';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0030';
mysql -u -p -h db_other_00 -e 'SELECT count(*) FROM uic_03.users_0031';