Reputation: 7221
I want to import a sql file of approx 5 GB. But its causing problem while loading. Is there any way to upload it without splitting the sql file ?
i have tried to import by terminal also but that also so many errors.
please help me on this.
Upvotes: 2
Views: 4617
Reputation: 3424
Method 1:- If you aren't familiar with the command line and you really want to stick with a GUI style import then you can use BigDump (http://www.ozerov.de/bigdump/).
If you are familiar with the command line and using a Linux based system then you can use code like like this:
mysql -u USERNAME -p DATABASENAME < FILENAME.sql
Finally, and most painfully, you could choose to dump individual tables or groups of tables into small enough dumps. Then restore these individual dumps one at a time via PHPMYADMIN.
You can approach second method also:
Method 2:- You can:
Upvotes: 2
Reputation: 45124
Most probably you won't be able to import a 5GB database on PHPMyAdmin. Try BigDump. You can download it here. Step are mentioned below.
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.
Else try the command line
mysql -u user_name -p database_name < path/to/the/file.sql
Upvotes: 2
Reputation: 7221
if your apache is not enabled to max file size 5GB than you can not import such big file.
Use php big dump tool its best ever i have seen. its free and opensource
http://www.ozerov.de/bigdump/
Upvotes: 1