我想导入一个大约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/