日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL5masterslave安裝配置全過程

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

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ù)庫)

 
 
 
  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

設置下面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線程不工作

報了很怪的錯誤

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ù)有問題,于是在

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

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

 
 
 
  1. replicate-do-db=test 

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

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

5)測試

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

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

再查數(shù)據(jù)庫數(shù)據(jù)似乎沒有更新,查看slave錯誤日志

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

原來都是我當初拷貝數(shù)據(jù)惹的禍,因為主機日志在我建數(shù)據(jù)庫的時候就開始了,所以我拷貝數(shù)據(jù)多此一舉,于是

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

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

【編輯推薦】

  1. 實現(xiàn)MySQL雙機熱備的實際操作步驟
  2. MySQL root密碼重置的三步驟
  3. 查看MySQL連接數(shù)的實際操作流程
  4. MySQL數(shù)據(jù)庫在實際應用一些方面的介紹
  5. MySQL數(shù)據(jù)庫日志的文件維護流程

標題名稱:MySQL5masterslave安裝配置全過程
URL地址:http://www.5511xx.com/article/cojppdo.html