Disclaimer: This article is a blogger original article, welcome to reprint, please indicate the source https://blog.csdn.net/mouday/article/details/90727803
With libraries
1, the target table does not exist
exist will get an error, make a list of student the same table student_replica
create table student_replica select * from student
2, the presence of the target table
will be inserted into the table student data in the table student_replica
insert into student_replica select * from student
Different libraries
# 数据导出
$ mysqldump -hlocalhost -P3306 -uroot -p123456 demo table > table.sql
# 数据导入
$ mysql -hlocalhost -P3306 -uroot -p123456 demo < table.sql
# 或者
> use db;
> source table.sql;
Reference:
MySQL data in a table into another table bulk
mysql mysqldump file export and import sql