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