博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MYSQL数据迁移
阅读量:6174 次
发布时间:2019-06-21

本文共 9638 字,大约阅读时间需要 32 分钟。

-- 清空数据表truncate table dsideal_db_bak.t_pro_product;truncate table dsideal_db_bak.t_resource_product_scheme;truncate table dsideal_db_bak.t_resource_info;truncate table dsideal_db_bak.t_resource_base;truncate table dsideal_db_bak.t_sjk_paper_info;truncate table dsideal_db_bak.t_sjk_paper_base;truncate table dsideal_db_bak.t_tk_question_info;truncate table dsideal_db_bak.t_tk_question_base;truncate table dsideal_db_bak.t_tk_question_type;truncate table dsideal_db_bak.t_tk_qt_subject;truncate table dsideal_db_bak.t_base_apptype;truncate table dsideal_db_bak.t_resource_scheme;truncate table dsideal_db_bak.t_resource_structure;truncate table dsideal_db_bak.t_resource_extension;-- =======================================================================================================================================-- t_pro_productinsert into dsideal_db_bak.t_pro_product(product_id,product_id_char,product_name,product_name_other,product_name_english,keye,keyn,remark,stage_id,plat_id,type_id,subclass_id,create_time,enter_em_id,sort_id,subject_id,system_id,platform_id,version_id)select product_id,product_id_char,product_name,product_name_other,product_name_english,keye,keyn,remark,stage_id,plat_id,type_id,subclass_id,create_time,enter_em_id,sort_id,subject_id,system_id,platform_id,version_id from dsideal_db_yun.t_pro_product;-- t_resource_product_schemeinsert into dsideal_db_bak.t_resource_product_scheme(id,product_id,product_id_char,scheme_id_char,scheme_id,ts,sort_id,b_use)select id,product_id,product_id_char,scheme_id_char,scheme_id,ts,sort_id,b_use from dsideal_db_yun.t_resource_product_scheme;-- dsideal_db_bak.t_resource_info;insert into dsideal_db_bak.t_resource_info(id,resource_id_int,resource_id_char,resource_title,resource_type_name,resource_format,resource_page,resource_size,resource_size_int,create_time,down_count,file_id,thumb_id,resource_type,structure_id,person_id,person_name,identity_id,group_id,preview_status,scheme_id_int,ts,thumb_status,update_ts,for_urlencoder_url,for_iso_url,width,height,parent_structure_name,release_status,res_type,bk_type,bk_type_name,material_type,m3u8_status,m3u8_url,app_type_id,stage_id,subject_id)select id,resource_id_int,resource_id_char,resource_title,resource_type_name,resource_format,resource_page,resource_size,resource_size_int,create_time,down_count,file_id,thumb_id,resource_type,structure_id,person_id,person_name,identity_id,group_id,preview_status,scheme_id_int,ts,thumb_status,update_ts,for_urlencoder_url,for_iso_url,width,height,parent_structure_name,release_status,res_type,bk_type,bk_type_name,material_type,m3u8_status,m3u8_url,app_type_id,-1,-1 from dsideal_db_yun.t_resource_info;-- dsideal_db_bak.t_resource_base;insert into dsideal_db_bak.t_resource_base(resource_id_int,resource_id_char,resource_title,resource_size,resource_size_int,resource_type,resource_type_name,resource_category,resource_page,create_time,person_name,create_person,b_use,update_logo,ts,source_id,extension,file_id,file_md5,file_sha1,thumb_id,thumb_md5,thumb_sha1,pinyin,product_id,scheme_id_char,scheme_id,structure_code,structure_id_char,structure_id,material_type,is_single,is_old,preview_status,down_count,check_status,check_message,thumb_status,old_file_path,is_multifile,chuli,is_3_2,parent_name,width,height,for_urlencoder_url,for_iso_url,release_status,res_type,bk_type,bk_type_name,m3u8_status,m3u8_url,stage_id,subject_id)select resource_id_int,resource_id_char,resource_title,resource_size,resource_size_int,resource_type,resource_type_name,resource_category,resource_page,create_time,person_name,create_person,b_use,update_logo,ts,source_id,extension,file_id,file_md5,file_sha1,thumb_id,thumb_md5,thumb_sha1,pinyin,product_id,scheme_id_char,scheme_id,structure_code,structure_id_char,structure_id,material_type,is_single,is_old,preview_status,down_count,check_status,check_message,thumb_status,old_file_path,is_multifile,chuli,is_3_2,parent_name,width,height,for_urlencoder_url,for_iso_url,release_status,res_type,bk_type,bk_type_name,m3u8_status,m3u8_url,-1,-1 from dsideal_db_yun.t_resource_base;-- dsideal_db_bak.t_sjk_paper_info;insert into dsideal_db_bak.t_sjk_paper_info(id,paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,down_count,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,group_id,resource_info_id,b_delete,oper_type)select id,paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,down_count,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,group_id,resource_info_id,b_delete,oper_type from dsideal_db_yun.t_sjk_paper_info;-- dsideal_db_bak.t_sjk_paper_base;insert into dsideal_db_bak.t_sjk_paper_base(paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,check_status,check_message,resource_info_id,down_count,old_paper_id,b_delete)select paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,check_status,check_message,resource_info_id,down_count,-1,b_delete from dsideal_db_yun.t_sjk_paper_base;-- dsideal_db_bak.t_tk_question_info;insert into dsideal_db_bak.t_tk_question_info(id,question_id_char,question_title,question_tips,question_type_id,question_difficult_id,create_person,group_id,down_count,ts,kg_zg,scheme_id_int,structure_id_int,json_question,json_answer,update_ts,structure_path,b_in_paper,paper_id_int,b_delete,oper_type,check_status,check_msg,use_count,sort_id)select id,question_id_char,question_title,question_tips,question_type_id,question_difficult_id,create_person,group_id,down_count,ts,kg_zg,scheme_id_int,structure_id_int,json_question,json_answer,update_ts,structure_path,b_in_paper,paper_id_int,b_delete,oper_type,check_status,check_msg,use_count,sort_id from dsideal_db_yun.t_tk_question_info;-- dsideal_db_bak.t_tk_question_base;insert into dsideal_db_bak.t_tk_question_base(question_id_char,question_title,question_tips,question_type_id,question_type_name,question_difficult_id,question_difficult_name,question_difficult_star,question_answer,create_time,create_person,b_use,source_id,ts,use_count,use_range,kg_zg,file_id,content_md5,doc_path,height,product_id,check_status,check_message,parent_id_char,json_question,json_answer,app_type,update_ok,options_count,subject_id,have_child,knowledgepoint)select question_id_char,question_title,question_tips,question_type_id,question_type_name,question_difficult_id,question_difficult_name,question_difficult_star,question_answer,create_time,create_person,b_use,source_id,ts,use_count,use_range,kg_zg,file_id,'-1',doc_path,height,product_id,check_status,check_message,parent_id_char,json_question,json_answer,app_type,update_ok,options_count,subject_id,have_child,knowledgepoint from dsideal_db_yun.t_tk_question_base;-- dsideal_db_bak.t_tk_question_type;insert into dsideal_db_bak.t_tk_question_type(qt_id,qt_name,create_time,b_use,qt_type)select qt_id,qt_name,create_time,b_use,qt_type from dsideal_db_yun.t_tk_question_type;-- dsideal_db_bak.t_tk_qt_subject;insert into dsideal_db_bak.t_tk_qt_subject(id,stage_id,subject_id,qt_id,sort_id)select id,stage_id,subject_id,qt_id,sort_id from dsideal_db_yun.t_tk_qt_subject;-- dsideal_db_bak.t_base_apptype;insert into dsideal_db_bak.t_base_apptype(app_type_id,app_prime_id,app_type_name,scheme_id,scheme_id_char,b_use,ts)select app_type_id,app_prime_id,app_type_name,scheme_id,scheme_id_char,b_use,ts from dsideal_db_yun.t_base_apptype;-- dsideal_db_bak.t_resource_scheme;insert into dsideal_db_bak.t_resource_scheme(scheme_id,scheme_id_char,scheme_name,stage_id,subject_id,b_use,ts,client_id,type_id,old_version_id,scheme_type)select scheme_id,scheme_id_char,scheme_name,stage_id,subject_id,b_use,ts,client_id,type_id,old_version_id,scheme_type from dsideal_db_yun.t_resource_scheme;-- dsideal_db_bak.t_resource_structure;insert into dsideal_db_bak.t_resource_structure(structure_id,structure_id_char,structure_code,scheme_id_char,scheme_id_int,level,structure_name,sort_id,b_use,is_root,create_time,ts,parent_id,show_type,type_id,node_id,node_code,version_id,stage_id,subject_id,tm_id,stype_id,is_3_2,is_leaf,is_delete)select structure_id,structure_id_char,structure_code,scheme_id_char,scheme_id_int,level,structure_name,sort_id,b_use,is_root,create_time,ts,parent_id,show_type,type_id,node_id,node_code,version_id,stage_id,subject_id,tm_id,stype_id,is_3_2,is_leaf,is_delete from dsideal_db_yun.t_resource_structure;-- dsideal_db_bak.t_resource_extension;insert into dsideal_db_bak.t_resource_extension(extension_id,extension_name,mediatype_id,mediatype_name,thumb_status,preview_status,thumb_id,ts,b_use)select extension_id,extension_name,mediatype_id,mediatype_name,thumb_status,preview_status,thumb_id,ts,b_use from dsideal_db_yun.t_resource_extension;-- =======================================================================================================================================-- 显示列名use information_schema;select group_concat(distinct column_name) from columns where table_name='t_resource_extension' and table_schema='dsideal_db_bak';

 

转载地址:http://ramba.baihongyu.com/

你可能感兴趣的文章
基于高德地图写的不同功能的地图应用
查看>>
DHCP服务器配置
查看>>
快速瓶颈识别
查看>>
运维工作总结201403
查看>>
我是菜鸟我加油……mysql主从同步
查看>>
[体系结构]设计模式(五)
查看>>
分布式文件系统
查看>>
其实很简单 微星为你详解Z77主板BIOS设置
查看>>
常见的shell变量
查看>>
This in Javascript
查看>>
在Ubuntu Kylin下安装JDK1.8
查看>>
Linux基本命令——组账户管理
查看>>
WebRTC 建立点对点连接(日志分析)
查看>>
822A - 协议栈、终端、shell、控制台
查看>>
我的友情链接
查看>>
AV_TIME_BASE
查看>>
The Switf programming Language 练习代码(5)
查看>>
JPA自定义sql返回 No Dialect mapping for JDBC type: 111
查看>>
Handler在主线程创建和在子线程创建的示例(18)
查看>>
java(十四)包装类型
查看>>