PDA

View Full Version : Importing Large SQL


Pikeypete
03-18-2010, 03:38 AM
Hey there,

Just need some general assistance; what would be the best way to import a large SQL?
I have it hosted on my server, and I attempted to import through SSH however this literally froze the server and the import completely, with the eventual disconnection.

The database in question is ~8GB.

Is there a better method?

Thanks for assistance

Marco van Herwaarden
03-19-2010, 12:16 PM
SSH is the way to go. I would first try by letting it run for 10 minutes, Most likely it will be finished in this time, but that also depends on the server. You could close your sites for a few minutes to speed up things.

Alternative would be to apply a nice factor to the process.

Ichigo88
03-23-2010, 07:58 PM
Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS. For most hosting companies, this will bring you into the FTP root folder.

You can either change directoties to wherever the backup is located and type in the following:

mysql -u dbusername -p databasename < backupname.sql

Or if you do not want to change directories and you know the path to where the backup is located, type in the following:

mysql -u dbusername -p databasename < /path/to/backupname.sql

You will be prompted for the database password. Enter it and the database will backup.

If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

mysql -h servername -u dbusername -p databasename < backupname.sql

Or:

mysql -h servername -u dbusername -p databasename < /path/to/backupname.sql

borbole
03-26-2010, 01:28 PM
Hey there,

Just need some general assistance; what would be the best way to import a large SQL?
I have it hosted on my server, and I attempted to import through SSH however this literally froze the server and the import completely, with the eventual disconnection.

The database in question is ~8GB.

Is there a better method?

Thanks for assistance

If SSH won''t work then give bigdump or mysqldumer a try. They both handle large files with ease.

Otherwise try to split up the backup file and import it piece by piece. I have done it several times and it has worked fine as well.

Oyabun
03-26-2010, 02:22 PM
<a href="http://www.mysqldumper.de" target="_blank">http://www.mysqldumper.de</a>