数据库导入导出(2)

mysql数据导入导出语句
导出:SELECT * from ebook INTO OUTFILE "bookdev.txt" FIELDS ENCLOSED by '"' TERMINATED by "," LINES TERMINATED BY " "
导入:LOAD DATA INFILE "bookdev.txt" into TABLE ebook FIELDS ENCLOSED by '"' TERMINATED by "," LINES TERMINATED BY " "

///////////////////////////////////////
mysql sql语句导入与导出
导入: mysql -u root -p 数据库名 如: C:\mysql\bin>mysql -u root -p house < c:\1-1.txt

导出: mysqldump -u root -p 数据库名 [表名1 表名2] > 输出地址 其中表名可选
如: 导出house中的blacklist表 C:\mysql\bin>mysqldump -u root house blacklist > c:\1-1.txt
导出house中的blacklist和userinfo表 C:\mysql\bin>mysqldump -u root house blacklist userinfo> c:\1-1.txt
导出house中的所有表 C:\mysql\bin>mysqldump -u root house > c:\1-1.txt
在使用mysqldump中可以使用 "-d" ,这时只导出表结构,没有数据 如: 导出house中的所有表 ,这时只有表结构 C:\mysql\bin>mysqldump -u root -d house > c:\1-1.txt 导出:SELECT * from ebook INTO OUTFILE "bookdev.txt" FIELDS ENCLOSED by '"' TERMINATED by "," LINES TERMINATED BY "\n"
导入:LOAD DATA INFILE "bookdev.txt" into TABLE ebook FIELDS ENCLOSED by '"' TERMINATED by "," LINES TERMINATED BY "\n"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值