full backup & restore mysql (linux)

14 Apr

1. backup
mysqldump -u root -p –all-databases > alldb_backup.sql

2. copy to traget
ftp 172.20.33.142
Name (172.20.33.142:root): oracle
Password:
ftp> put alldb_backup.sql
ftp> bye

3. remote
ssh root@172.20.33.142
root@172.20.33.142’s password:

4. restore
cd /home/oracle
mysql -u root -p  < alldb_backup.sql
Enter password:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: