Posts Tagged ‘restore’

Rename a MySql database

Sunday, January 10th, 2010

This morning I needed to rename my database and found these three commands I’m going to show you:

mysqldump -u username -p -v olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql

[ source: stackoverflow.com ]

Backup and restore your linux workstation

Monday, January 4th, 2010

Take this as a note rather than a guide, by the way don’t forget to execute these commands as root.
Backup:

cd /
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found \
    --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/dev /

Restore:

tar xvpfz backup.tgz -C /
mkdir proc lost+found mnt sys dev

[ source Ubuntu Forums ]