Terminal Heroes – 1 – mysql backup insert
Just a quick note while dumping a 70MB database… ;-) Let’s say i got my database backup from phpmyadmin, compressed with gz (zip’s also fine), while getting the backup,even if it’s BIG ain’t really a problem, putting it into the database can be troublesome becouse timeout’s etc, especially if it’s a BIG file ;-) My tip here is:
Download the compressed backup
Put it onto your target server, by FTP, SFTP or SCP, doesn’t really matter
Launch SSH and use your terminal hero skillzorz:
cd where/i/put/the/file
gunzip backup.sql.gz #or unzip backup.sql.zip
mysql-u username -D database_name -pPASSWD < backup.sql
cowsay "data imported, yay!"
It’s pretty self explanatory I guess, and MUCH faster and more reliable than any other way of doing this :-)
My backup should finish downloading any second now, so… cya soon!


Post a reply