怎么一次性将数据存入到mysql中,如何将几个.sql文件一次导入mysql数据库?

I have several .sql files and I want to import all of them at once into a MySQL database.

I'm using WAMP, and until now:

I go to PHPMyAdmin, then I access to the database, I click "import" and I select a file and import it. But as I have more than 10 files, I would like to know if there is a better way to do it, something like one file which imports the other files or similar.

I would like solutions without installing additional programs in my computer.

Thank you in advance.

解决方案

Thanks BlackCharly, I found how to do it in Windows, open a terminal go to content folder and write:

copy /b *.sql all_files.sql

This concate all files in only one, making it really quick to import with PhpMyAdmin

In linux, as BlackCharly says:

cat *.sql > all_files.sql

Last but not least, please, take into account the @mosh comment:

If all_files.sql is already present, this can result in recursive copy

of the file on itself with no end! Put the result in a separate

directory to be safe.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值