mysql誤刪了一個數(shù)據(jù)庫,怎么恢復(fù)?下面為大家?guī)韒ysql恢復(fù)到一個新的mysql主和從數(shù)據(jù)庫教程,詳情內(nèi)容如下:
環(huán)境介紹:有兩套mysql主從(A和B),現(xiàn)需求將A套的mysql從庫恢復(fù)到B套的mysql主庫和從庫。執(zhí)行過程如下:
先將A套的mysql從庫備份,傳至B套服務(wù)器上
從庫操作
停止主從關(guān)系
slave stop;
然后分別恢復(fù)B套的主和從的數(shù)據(jù)庫
mysql -uroot -proot
use dbname
source /data/tmp/dbname_20141010.sql
從庫鏈接主庫的用戶slave 密碼slave (如果忘記了可以新建一個用戶http://xficc.blog.51cto.com/1189288/1562168)
主庫 查詢 FILE 及 Position 的值
show master status;
從庫 配置
mysql> change master to
master_host='主庫ip',
master_user='slave',
master_password='slave',
master_log_file='mysql-bin.000007', #主庫 查出來的 show master status;
master_log_pos=7; #主庫 查出來的 show master status;
然后執(zhí)行 slave start;
##################################################################
查看主庫狀態(tài)
show processlist\G;
//state狀態(tài)應(yīng)該為Has sent all binlog to slave; waiting for binlog to be updated
查看從庫狀態(tài)
show slave status\G;
//Slave_IO_Running 與 Slave_SQL_Running 狀態(tài)都要為Yes
show processlist;
//應(yīng)該有兩行state值為:
Has read all relay log; waiting for the slave I/O thread to update it
Waiting for master to send event
- mysql數(shù)據(jù)庫64位【支持win7/win10】5.7.17.0 官方中文最新版
- mysql數(shù)據(jù)庫64位是最新的mysql數(shù)據(jù)庫版本了,同時也是支持中文的版本,在現(xiàn)在這個版本是可以支持win10的系統(tǒng)以及win8.1的版本,有需要體驗下這個mysql數(shù)據(jù)庫64位怎么樣的,可以先來本站免費的下載試試效果怎么樣!
語言:
中文大。
350.9M類型:
數(shù)據(jù)庫更新:
2016-12-13推薦等級:
廠商: