php - 如何在 phpmyadmin 中导入 5 GB MySQL Dump 文件

标签 php mysql

我想导入一个大约 5 GB 的 sql 文件。但它在加载时引起问题。有没有办法在不分割sql文件的情况下上传它?

我也尝试通过终端导入,但也有很多错误。

请帮我解决这个问题。

最佳答案

您很可能无法在 PHPMyAdmin 上导入 5GB 数据库。试试BigDump 。您可以下载here 。步骤如下。

Download and unzip bigdump.zip on your PC.

Open bigdump.php in a text editor, adjust the database configuration and dump file encoding.

Drop the old tables on the target database if your dump doesn’t contain “DROP TABLE” (use phpMyAdmin).

Create the working directory (e.g. dump) on your web server

Upload bigdump.php and the dump files (*.sql or *.gz) via FTP to the working directory (take care of TEXT mode upload for bigdump.php and dump.sql but BINARY mode for dump.gz if uploading from MS Windows).

Run the bigdump.php from your web browser via URL like http://www.yourdomain.com/dump/bigdump.php.

Now you can select the file to be imported from the listing of your working directory. Click “Start import” to start.

BigDump will start every next import session automatically if JavaScript is enabled in your browser.

Relax and wait for the script to finish. Do NOT close the browser window!
IMPORTANT: Remove bigdump.php and your dump files from your web server.

或者尝试命令行

mysql -u user_name -p database_name < path/to/the/file.sql

关于php - 如何在 phpmyadmin 中导入 5 GB MySQL Dump 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30256044/

相关文章:

php - 数据库没有更新

php - laravel 4 多数据库连接

php - 计算多个 MySQL 表中的行数?

mysql - 如何组合这两个 MySQL 语句

php - 无法在 Blade 中显示两列结果,laravel 5.1

php - 哪个更好? MySQL 中的磁盘文件缓存或临时表缓存

php - 对所有子域使用一个 session

MySQL触发器根据另一个表的变化更新一个表

php - 打印无意义的文本行会阻止页面下载,但太多行会阻止获取 mysql 表中的所有条目。为什么?

php - 原始价格未显示在 magento 1.8.1 的销售订单 View 中?