开发者

Generating SQL script from MySQL database table

开发者 https://www.devze.com 2022-12-23 06:21 出处:网络
Is there any application that will read a MySQL database table and generate a SQL script of INSERT statements (so that I can copy tables from one db to another db)? OR how can I transfer开发者_StackOv

Is there any application that will read a MySQL database table and generate a SQL script of INSERT statements (so that I can copy tables from one db to another db)? OR how can I transfer开发者_StackOverflow content from db1.table1 to db2.table2 where table1 and table2 is same.

Thank you.


mysqldump [options] db_name [tbl_name ...]

Will generate the script file including the create and inserts necessary for the tables selected. To import the dump you can simply do:

mysql -u <user> -p dbname < mys.dmp


You should take a look at mysqldump. You can specify the --nodata option to export the schema only.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号