phpMyAdmin:无法导入庞大的数据库文件,有什么建议吗? [英] phpMyAdmin: Can't import huge database file, any suggestions?

查看:24
本文介绍了phpMyAdmin:无法导入庞大的数据库文件,有什么建议吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近买了一台新电脑,所以我想把我所有的网络项目都搬过来.移动文件很容易,但是,移动数据库似乎有点困难.我使用 phpMyAdmin 导出了所有数据库,并将其保存到 localhost.sql.然后我尝试在我的新计算机上也使用 phpMyAdmin 导入它,但出现错误:

I recently got a new computer, so I thought I'd move all my web projects over. Moving the files was easy, however, moving the database seems to be a bit harder. I exported ALL databases using phpMyAdmin, and saved it to localhost.sql. Then I tried to import it on my new computer also using phpMyAdmin, and I get the error:

No data to import. Either no filename was sent or the filesize exceeded the maximum allowed size. See FAQ 1.16. (This was translated from Swedish)

我按照建议查看了常见问题解答.他们提到了一个名为 BigDump 的工具.所以我下载了它,在查看了运行它所需的设置后,我意识到我不能使用它.为什么?因为它需要连接到一个特定的数据库.我正在尝试一次导入许多数据库.所以,那里没有成功.

I took a look at the FAQ, as advised. And they mentioned a tool called BigDump. So I downloaded it, and after looking at the settings you need to run it I realised that I CAN'T USE THAT EITHER. Why? Because it requires a connection to one specific database. I'm trying to import MANY databases at once. So, no success there.

我还尝试将 PHP 的 upload_max_filesize(以及常见问题解答中提到的另一个)设置为 999 之类的值.出于某种原因,这似乎也不起作用.在再次运行之前,我确实重新启动了所有服务.

I also tried setting PHP's upload_max_filesize (and the other one's mentioned in the FAQ) to something like 999. That doesn't seem to work either for some reason. I did restart all services before I ran it again.

我应该提到我在旧计算机上使用 XAMPP,而在新计算机上切换到 WAMP.不过那应该没关系吧?由于两个包"都使用 phpMyAdmin 和 apache.

I should mention that I used XAMPP on my old computer, and I switched to WAMP on my new one. That shouldn't matter though, right? As both "packages" uses phpMyAdmin and apache.

关于如何绕过这个噩梦的任何建议?

Any suggestions on how to bypass this nightmare?

推荐答案

操作方法

确保您在 "php.ini"(位于 "php.exe"> 是).

Make sure you change both *"post_max_size"* and *"upload_max_filesize"* in your "php.ini" (which is located where your "php.exe" is).

以下示例允许您上传和导入 128MB 的 sql 文件:

The following example allows you to upload and import 128MB sql files:

post_max_size=128M
upload_max_filesize=128M

重启 Apache,一切就绪.

Restart Apache and you're all set.

替代方案

解决该问题的另一种方法是使用命令行.但这是一种变通方法,并且与变通方法一样丑陋:

An alternative way to work around the problem is to use the command line. But it's a workaround, and as ugly as workarounds get:

C:xamppmysqlmysql.exe -u root -p db_name < C:some_pathyour_sql_file.sql

由于您使用的不是服务器而是命令行,因此上传和 POST 大小无关紧要.这就是我将其称为解决方法"的原因,因为它实际上并不能解决您的问题.

As you're not using the server but the command line, upload and POST sizes don't matter. That's why I call this a "workaround", since it doesn't actually solve your problem.

这篇关于phpMyAdmin:无法导入庞大的数据库文件,有什么建议吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆