mysql: backing up & restoring db
mysqldump -u mysqluser -p mysqlpassword mysqldatabase > db_backup.sql # simple backup
mysqldump -u mysqluser -p mysqlpassword mysqldatabase | gzip > db_backup.sql.gz # gzipped backup
cat db_backup.sql | mysql -u mysqluser -p mysqlpassword mysqldatabase # simple restore
gunzip < db_backup.sql.gz | mysql -u mysqluser -p mysqlpassword mysqldatabase # restoring gzipped sql file