MySQL Data migration

Source: Internet
Author: User

--Empty data table 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)SelectProduct_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 fromdsideal_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)SelectId,product_id,product_id_char,scheme_id_char,scheme_id,ts,sort_id,b_use fromDsideal_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)SelectId,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  fromDsideal_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)SelectResource_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  fromdsideal_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)SelectId,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 fromDsideal_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)SelectPaper_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 fromdsideal_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)Selectid,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 fromDsideal_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)SelectQUESTION_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 fromdsideal_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)SelectQt_id,qt_name,create_time,b_use,qt_type fromDsideal_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)Selectid,stage_id,subject_id,qt_id,sort_id fromDsideal_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)SelectApp_type_id,app_prime_id,app_type_name,scheme_id,scheme_id_char,b_use,ts fromDsideal_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)SelectScheme_id,scheme_id_char,scheme_name,stage_id,subject_id,b_use,ts,client_id,type_id,old_version_id,scheme_type fromDsideal_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)SelectStructure_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 fromdsideal_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)SelectExtension_id,extension_name,mediatype_id,mediatype_name,thumb_status,preview_status,thumb_id,ts,b_use fromdsideal_db_yun.t_resource_extension;-- ============================================================================================================= ==========================--display column name use INFORMATION_SCHEMA;SelectGroup_concat (DISTINCT column_name) fromColumnswhereTable_name='t_resource_extension'and table_schema='Dsideal_db_bak';

MySQL Data migration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.