基於web頁面導入較大的sql腳本到mysql

如果導出的數據庫sql文件較大,如果通過phpmyadmin導入,往往會失敗,而在虛擬主機上往往不具備shell權限,沒辦法從命令行導入,如果找服務商,一次二次還行,如果多次,我想對方臉色肯定不好看,算不定還要收費。

基於如此,需要找一個支持webase的大數據導入的工具,BigDump就是用於此目的的。

BigDump: Staggered MySQL Dump Importer

Staggered import of large and very large MySQL Dumps (like phpMyAdmin 2.x Dumps) even through the web-servers with hard runtime limit and those in safe mode. The script executes only a small part of the huge dump and restarts itself. The next session starts where the last was stopped.

軟件下載地址:http://www.ozerov.de/bigdump.zip

網址:http://www.ozerov.de/bigdump.php

常見問題:
Q: I get an error: "MySQL: Table 'some_tbl_name' already exists". Why?

A: Your dump file doesn't contain DROP queries. Use phpMyAdmin to drop all the tables on the target database which must be restored before you start the import.

Q: I get an error: "Fatal error: Allowed memory size of xxx bytes exhausted" or "MySQL server has gone away". Why?

A: Your dump file probably contains extended inserts. An extended insert contains all table entries within one SQL query. BigDump isn't able to split such SQL queries. Please turn off extended inserts when exporting database from phpMyAdmin.

Q: Why does BigDump fail putting strange SQL errors if I run it from the localhost on my Windows PC?

A: This is IMHO a bug in the PHP 4.3.x that is crashing BigDump on Win32 if using a dump file with DOS encoded line breaks (contact me for details). As workaround create your dump with only the UNIX line breaks or convert it into UNIX format using some text editor. Then you will be able to run BigDump also at your localhost.

Q: Can I use dump files created by other software than phpMyAdmin?

A: You can use any text dump file at your own risk. Although it's very important for BigDump to find a semicolon followed by a line break at the end of each query. It won't work else since it has no time to parse the queries to find their proper ends. Further BigDump behaviour can be unpredictable if your dump file is using double quotes to surround strings. BigDump won't work too if your dump file contains any proprietary comment lines (like in some dumps created by other tools). Although you can use the $comment setting in bigdump.php to drop non-standard comment lines by their first characters. Apart from that BigDump doesn't filter the dump file in any way.

Q: Why don't you provide any facility to input the database configuration from the browser form?

A: Input the database configuration from the form would be very insecure since the settings must be saved in the cookies or returned to your browser everytime the session ends.

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值