自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL5 master slave安裝配置全過(guò)程

數(shù)據(jù)庫(kù) MySQL
以下的文章主要講述的是MySQL5 master slave安裝配置的實(shí)際操作過(guò)程,希望會(huì)給你帶來(lái)一些幫助在其實(shí)際操作方面。

我們今天主要向大家介紹的是MySQL5 master slave安裝配置的實(shí)際操作過(guò)程,我們?cè)趯?duì)MySQL5 master slave進(jìn)行安裝配置日志在以下的背景中,以下就是文章的具體內(nèi)容的介紹,望你瀏覽之后會(huì)有所收獲。

master:192.168.100.231 MySQL(和PHP搭配之最佳組合)5.0.19 linux

slave: 192.168.100.234 MySQL(和PHP搭配之最佳組合)5.0.18 linux

step1) 配置master

在/etc/init.d MySQL(和PHP搭配之最佳組合)d段加入

要同步的數(shù)據(jù)庫(kù))

  1. binlog_do_db = test 

并確保

 

  1. server-id=1 
  2. log-bin=MySQL(和PHP搭配之最佳組合)-bin  
  3. step2) 授權(quán)slave  
  4. GRANT REPLICATION SLAVE ON *.* TO test@192.168.100.234 IDENTIFIED BY '123';  

 

重啟master

step3)配置slave

vi /etc/my.cnf

設(shè)置下面4行

 

  1. server-id = 2 
  2. master-host = 192.168.100.231  
  3. master-user = test 
  4. master-password = 123 

 

重啟發(fā)現(xiàn)slave的I/O線程工作正常,而SQL線程不工作

報(bào)了很怪的錯(cuò)誤

070307 16:30:27 [ERROR] Slave: Error 'Table 'passport.loginuser' doesn't exist' on query. Default database: 'passport'. Query: 'delete from loginuser where tokenRefreshTime<='2006-07-03 07:00:00'', Error_code: 1146

070307 16:30:27 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'MySQL(和PHP搭配之最佳組合)-bin.000001' position 98

因該是relay log中的數(shù)據(jù)有問(wèn)題,于是在

將master機(jī)器上的數(shù)據(jù)拷到244,發(fā)現(xiàn)還是有問(wèn)題。

于是在/etc/my.cnf中加入

 

  1. replicate-do-db=test 

MySQL5 master slave安裝配置日志中需要重啟slave,

show slave status發(fā)現(xiàn)兩個(gè)線程工作正常

5)測(cè)試

在master的test數(shù)據(jù)的user表中添加了一條記錄

然后在slave上通過(guò)show processlist看slave工作情況一切正常,

再查數(shù)據(jù)庫(kù)數(shù)據(jù)似乎沒(méi)有更新,查看slave錯(cuò)誤日志

070307 16:45:16 [ERROR] Slave: Error 'Can't create database 'test'; database exists' on query. Default database: 'test'. Query: 'create database test', Error_code: 1007
070307 16:45:16 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'MySQL(和PHP搭配之最佳組合)-bin.000040' position 70671

原來(lái)都是我當(dāng)初拷貝數(shù)據(jù)惹的禍,因?yàn)橹鳈C(jī)日志在我建數(shù)據(jù)庫(kù)的時(shí)候就開(kāi)始了,所以我拷貝數(shù)據(jù)多此一舉,于是

我刪除拷貝的數(shù)據(jù)庫(kù),一切ok

以上的相關(guān)內(nèi)容就是對(duì)MySQL5 master slave安裝配置日志的介紹,望你能有所收獲。

【編輯推薦】

  1. 實(shí)現(xiàn)MySQL雙機(jī)熱備的實(shí)際操作步驟
  2. MySQL root密碼重置的三步驟
  3. 查看MySQL連接數(shù)的實(shí)際操作流程
  4. MySQL數(shù)據(jù)庫(kù)在實(shí)際應(yīng)用一些方面的介紹
  5. MySQL數(shù)據(jù)庫(kù)日志的文件維護(hù)流程
責(zé)任編輯:佚名 來(lái)源: 博客園
相關(guān)推薦

2010-06-10 12:55:18

MySQL5 mast

2011-02-22 10:46:02

Samba配置

2009-12-08 17:56:16

WCF配置

2011-09-06 15:38:20

QT安裝

2011-01-21 17:51:52

2011-04-02 09:20:23

freebsdmrtg安裝

2009-06-10 16:55:42

cygwin netb安裝

2010-03-10 13:24:45

Zend Debugg

2011-03-11 10:39:02

YUM安裝LAMP

2010-03-26 14:48:03

Ylmf OS 2.0

2010-03-30 10:11:53

CentOS源

2010-11-19 09:30:29

2009-06-09 16:17:45

SQL Server

2011-04-18 15:56:10

軟件測(cè)試

2009-04-13 12:37:18

2009-03-04 10:10:49

PVS服務(wù)器桌面虛擬化Xendesktop

2009-10-21 09:14:26

Visual Stud

2010-03-01 17:01:03

Python編程技巧

2010-06-17 13:10:09

Linux Grub修

2010-11-19 10:11:49

Oracle物化視圖
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)