簡體   English   中英

如何在phpmyadmin中導入5 GB MySQL Dump文件

[英]How to import 5 GB MySQL Dump file in phpmyadmin

我想導入一個大約5 GB的sql文件。 但是它導致加載時出現問題。 有什么方法可以上傳而不拆分sql文件嗎?

我也嘗試過通過終端導入,但是也有很多錯誤。

請幫助我。

很可能您將無法在PHPMyAdmin上導入5GB數據庫。 嘗試BigDump 您可以在這里下載。 步驟在下面提到。

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

如果您的apache未啟用最大文件大小5GB,則無法導入這么大的文件。

使用php big dump工具是我見過的最好的工具。 它的自由和開源

http://www.ozerov.de/bigdump/

方法1:-如果您不熟悉命令行,並且確實想堅持使用GUI樣式導入,則可以使用BigDump( http://www.ozerov.de/bigdump/ )。

  • 我曾經使用過,但是已經有一段時間了。 據我所知,您將下載一個名為bigdump.php的文件(帶有一些說明),並將其放在MySQL DB轉儲文件所在目錄的Web服務器上,該文件太大而無法通過PHPMYADMIN導入。
  • 然后使用您的瀏覽器導航至它-類似於http://your-website.com/bigdump.php

如果您熟悉命令行並使用基於Linux的系統,則可以使用如下代碼:

mysql -u USERNAME -p DATABASENAME < FILENAME.sql
  • 但是,在運行此命令之前,數據庫和用戶(具有數據庫特權)將需要存在。
  • 注意我從其他來源復制了上面的命令。 我總是這樣進行轉儲和還原:DUMP:mysqldump -u DB_USER -h DB_HOST -pDB_PASSWORD DB_NAME | gzip -9> DB_NAME.sql.gz恢復:gunzip <PATH_TO_DUMP / DB_NAME.sql.gz | mysql -u DB_USER -pDB_PASSWORD DB_NAME

最后,最痛苦的是,您可以選擇將單個表或表組轉儲到足夠小的轉儲中。 然后通過PHPMYADMIN一次還原這些單個轉儲。

您也可以采用第二種方法:

方法2:-您可以:

  • 增加memory_limit
  • 增加post_max_size
  • 增加max_execution_time
  • 完成所有這些操作后必須重新啟動Apache。
  • 或使用Big Dump

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM