尝试导入 sql 时 PhpMyAdmin 文件太大错误

发布于 2024-09-29 18:36:08 字数 380 浏览 5 评论 0 原文

大家好,我正在尝试在客户端服务器上使用 phpmy admin 导入数据库(.sql)文件。

我收到文件太大错误,即使我可以选择将文件分成几部分等,但我仍然收到错误。上传大小为 50MiB,我尝试导入的文件为 90mb(对于数据库)。

我在 MAM 中遇到了相同的错误,并且知道我可以更改 maz_size_limit 和类似的内容,但我不确定在客户端上该怎么做服务器。我可以访问 cpanel,但看不到任何选项。

我可以在我的服务器上导入相同的文件,即使它设置为 64MB,因为它能够分割和导入。

我在这里有什么选择?

我尝试使用 mysequal pro,因为它适用于我本地计算机上的 MAMP,但无法为此客户端服务器执行此操作。

有什么想法吗?

Hey folks, I am trying to import a database (.sql) file using phpmy admin on a clients server.

I get a file too large error even thought I have the option to break the file into pieces etc but I still get the error. The upload size is 50MiB and the file I am trying to import is 90mb (for the db.)

I had the same error in MAM and know I could change the maz_size_limit and similar things, but I am not sure what to do on the clients server. I have access to the cpanel but can not see any options.

I can import the same file on my server, even though its set to 64MB,as it is able to chop up and import.

What are my options here?

I tried to use mysequal pro as it worked for MAMP on my local comp but am not able to do it for this clients server.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

木緿 2024-10-06 18:36:09

最好的选择是将其通过 FTP 传输到服务器,然后通过 ssh 输入(命令行)并以这种方式导入数据库。生成的命令将类似于:

mysql -hlocalhost -uUser -pPassword database_name < file_name

这样您就可以完全绕过任何文件上传或处理时间限制。

Your best bet is to FTP it to the server and then ssh in (command line) and import the database that way. The resulting command will look something like:

mysql -hlocalhost -uUser -pPassword database_name < file_name

That way you can completely bypass any file upload or processing time restrictions.

故事未完 2024-10-06 18:36:09

您对客户服务器有什么样的访问权限?

如果您确实有终端访问权限,那么上述答案将起作用。

否则,一个非常丑陋的方法是,您可以创建一个 .htaccess 文件来更改 PHP 设置,以通过 PHPmyAdmin 上传 sql 文件。

在您的 .htaccess 文件中,您可以输入:

php_value upload_max_filesize 80M
php_value post_max_size 80M
php_value max_execution_time 300
php_value max_input_time 300

确保完成后立即删除您的 .htaccess 文件。此外,如果您的客户端服务器使用 Apache 设置为不允许覆盖,则此操作将不起作用。

What kind of access do you have to your client's server?

If you do have terminal access then the above answers will work.

Otherwise, a very ugly way to get it done is that you could create an .htaccess file to change PHP settings to get the sql file uploaded through PHPmyAdmin.

In your .htaccess file you would put:

php_value upload_max_filesize 80M
php_value post_max_size 80M
php_value max_execution_time 300
php_value max_input_time 300

Make sure you delete your .htaccess file as soon as you are done. Also, this will not work if your client's server is using Apache set not to allow overrides.

凉风有信 2024-10-06 18:36:09

另一个选项:

/.../phpmyadmin3.2.0.1/config.inc.php

找到带有 $cfg['UploadDir'] 的行并将其更新为:

$cfg['UploadDir'] = 'upload';

在 phpmyadmin 目录中创建一个名为“upload”的目录。

将您的文件放入这个新的上传目录中,然后您将在“导入”页面上看到一个新的下拉列表。

资料来源: http://daipratt.co.uk/importing-大文件到 mysql-with-phpmyadmin/

Another option:

/.../phpmyadmin3.2.0.1/config.inc.php

Find the line with $cfg['UploadDir'] on it and update it to:

$cfg['UploadDir'] = 'upload';

Create a directory called 'upload' within the phpmyadmin directory.

Place your file in this new upload directory, then you'll see a new dropdown on the Import page.

Source: http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/

孤云独去闲 2024-10-06 18:36:09

您尝试导入的文件是原始 .sql 形式吗?如果没有,请尝试对其进行压缩/gzip 压缩。对于文本文件,您可以看到文件大小大大减少,这可能允许您在不更改任何 PHP 配置文件的情况下上传它。

Is the file you are trying to import in raw .sql form? If not, then try zipping/gzipping it. For text files, you can see HUGE reductions in file size, which might allow you to upload it without changing any PHP configuration files.

_蜘蛛 2024-10-06 18:36:09

您可以使用命令行导入任何未压缩的文件,无论大小如何。

mysql -h <host> -u <user> -p <database> < path/file.sql
  • 如果您使用本地主机,则不需要 -h,
  • 如果用户没有密码,则不需要 -p

You can use the command line to import any uncompressed file, no matter the size.

mysql -h <host> -u <user> -p <database> < path/file.sql
  • if you are using your localhost you don't need the -h and
  • if the user do not have a password you don't need the -p
许久 2024-10-06 18:36:09

PHP 通常对上传的文件大小有限制。最好的选择是通过 FTP 传输文件并通过 ssh 登录,然后通过 mysql 命令行导入 sql 脚本

PHP usually has a file size restriction for uploads. Your best bet is to FTP the file and login through ssh and import the sql script through the mysql command line

白龙吟 2024-10-06 18:36:09

您可以通过以下方式进行操作;

  1. 您可以转到控制面板/cpanel 并添加主机 % 这意味着现在可以从您的本地计算机访问数据库服务器。现在你可以安装并使用 MySQL Administrator 或 Navicat 导入和导出数据库,而无需使用 PHP-Myadmin,我使用它多次上传 200 MB 到 500 MB 的数据,没有任何问题

  2. 使用 gzip、bzip2 压缩进行导出和输入。我在 Windows 中使用 PEA ZIP 软件(免费)。尽量避免使用 Winrar 和 Winzip

  3. 使用 MySQL Splitter 将 sql 文件分成几个部分。我个人的建议是,不推荐

  4. 正如其他朋友提到的那样,使用 PHP INI 设置(动态更改最大上传和最大执行时间)是富有成效的,但并不总是如此。

  5. 此外,如果 SSH 可用,您还可以通过终端使用 SQLDUMP

You can do it in following ways;

  1. You can go to control panel/cpanel and add host % It means now the database server can be accessed from your local machine. Now you can install and use MySQL Administrator or Navicat to import and export database with out using PHP-Myadmin, I used it several times to upload 200 MB to 500 MB of data with no issues

  2. Use gzip, bzip2 compressions for exporting and importing. I am using PEA ZIP software (free) in Windows. Try to avoid Winrar and Winzip

  3. Use MySQL Splitter that splits up the sql file into several parts. In my personal suggestion, Not recommended

    1. Using PHP INI setting (dynamically change the max upload and max execution time) as already mentioned by other friends is fruitful but not always.

    2. Also, you can use SQLDUMP via terminal, if SSH is available

甜是你 2024-10-06 18:36:09

上传之前尝试压缩 .SQL 文件。我已将 100MB+ 压缩到 ~10MB,但 phpMyAdmin 失败并出现以下错误:

致命错误:允许的内存大小 94371840 字节已耗尽(尝试
分配106954753字节)

如果未压缩的 .SQL 文件小于或等于 94MB,则可以正常压缩并上传。

Try compressing the .SQL file before uploading it. I've compressed 100MB+ down to ~10MB but phpMyAdmin fails with this error:

Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to
allocate 106954753 bytes)

If your uncompressed .SQL file is less than or equal to 94MB it should work just fine to zip it and upload.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文