把数据从tidb中导出到mysql数据库中
# docker ps 找出容器id
# 进入容器
# docker exec -it 44a9fa0f6c02 sh
# 发现是4000端口映射到了主机的3306端口
# 访问tidb
mysql -h192.168.11.222 -P 3306 -u root -p -D common
# 导出数据
mydumper -h 192.168.11.222 -P 3306 -u root -p 'pass' -t 4 -F 256 -B common -T emails -o /opt/common/
# 把线上环境备份,并且rename,然后
mysqldump -uroot -p --default-character-set='utf8' common emails > /opt/emails20200514.sql
use common;
alter table emails rename to emails20200514;
CREATE TABLE `emails` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0:未校验 1:已校验为有效邮箱 2:已校验为无效邮箱 3:未校验出来(网络问题、IP黑名单等) 4:校验超时 5:格式错误 6:其它 ',
`verify_platform` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '校验平台',
`is_success_send` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否已经成功给该邮箱用户发送过邮件 0-没发送或者发送失败 1-已成功发送',
`is_click` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发送给该用户的邮件是否已经被点开 0-没有或者没有发送 1-已点开',
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '备注',
`update_time` int(11) NOT NULL DEFAULT '0',
`create_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
进入mysql shell
source xx.sql导入数据
来源:oschina
链接:https://my.oschina.net/u/4408225/blog/4279671