Replication between mysql tables, the same database and different databases, mysql table replication Database
Mysql statement
We can first export the structure of table t1 under test, and then create a new table test1.t1.
Execute the following statement
Insert into test1.t1 select * from test. t1 limit 2 (limit)
In a database
Insert into t1 select * from t2 limit 2
If the table structure is different for the two tables, consider, and refer to the following statements
INSERT into db_ds_edu.t_exam_student (stu_id, stu_number, stu_name, school_id, campus_id, grade_id, class_id, xuebu_id) SELECT stu. id, stu. student_num, person. name, stu. school_id, stu. campus_id, stu. grade_id, stu. clas_id, stu. xuebu_id FROM db_ds.t_stu_info AS stu, db_ds.t_p_person_info as person WHERE stu. person_id = person. id
Moda
Insert into test1.t1 select * from test. t1 limit 2