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

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

问题描述

最近我有一台新电脑,所以我想将所有的Web项目移到其他地方.移动文件很容易,但是移动数据库似乎有点困难.我使用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" 所在的位置)中同时更改*"post_max_size" *和*"upload_max_filesize" * >是).

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:\xampp\mysql\mysql.exe -u root -p db_name < C:\some_path\your_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天全站免登陆