show variables ——显示系统变量(扩展show variables like 'XXX')
在MYSQL的主从复制中 ,通过命令show master status,可以查看master数据库当前正在使用的二进制日志及当前执行二进制日志位置
show master logs,查看所有二进制日志列表 ,和show binary logs 同义。
mysql 导数据
mysql -B -uadmin -padmin bce_dts -h127.0.0.1 -e 'select * from dts_task;' > test.txt
多线程导出数据
starttime=$(date +%Y-%m-%d\ %H:%M:%S)
echo $starttime
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest1 > sbtest1.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest2 > sbtest2.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest3 > sbtest3.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest4 > sbtest4.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest5 > sbtest5.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest6 > sbtest6.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest7 > sbtest7.sql &
time mysqldump -h10.113.165.21 -P3310 -uadmin -padmin increase_test sbtest8 > sbtest8.sql &
wait
多线程导入数据
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest1.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest2.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest3.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest4.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest5.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest6.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest7.sql &
time mysql -h10.92.135.42 -P6101 -uroot -pabc13579 increase_test < sbtest8.sql &
wait