Home > Database > Mysql Tutorial > 记录一次MySQL逻辑备份与恢复的演练_MySQL

记录一次MySQL逻辑备份与恢复的演练_MySQL

WBOY
Release: 2016-06-01 13:33:04
Original
819 people have browsed it

bitsCN.com

记录一次MySQL逻辑备份与恢复的演练

 

流程大概是这样的:

     

     从 42.121.189.236 拿数据到 192.168.1.119 然后再把数据送到 192.168.1.110 上恢复

     

     那么、接下来就来看看这个过程、

     

     ㈠ 在192.168.1.119上从 42.121.189.236 上拿数据、并送给 192.168.1.110 

[plain] 

$ mysqldump -udavid -p123 -h42.121.189.236 --single-transaction --lock-tables --force --master-data=1 --databases cdio > /tmp/cdio_bak.sql  

  

# tar -jcv -f cdio_bak.sql.tar.bz2 cdio_bak.sql  

  

# scp cdio_bak.sql.tar.bz2 192.168.1.110:/tmp/  

 

 

     ㈡ 在 192.168.1.110 上恢复并验证

[plain] 

# tar -jxv -f cdio_bak.sql.tar.bz2 -C /home/mysql  

  

$ mysql -uroot -poracle

  

mysql> show databases;  

+--------------------+  

| Database           |  

+--------------------+  

| information_schema |  

| cdio               |  

  

mysql> use cdio;  

Database changed  

  

mysql> select count(*) from t_visitor;  

+----------+  

| count(*) |  

+----------+  

|      313 |  

+----------+  

 

 

By David Lin 

2013-06-09

Good Luck 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template