偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

MySQL5 master slave安裝與配置日志很簡單

數(shù)據(jù)庫 MySQL
以下的文章主要向大家描述的是MySQL5 master slave安裝與配置日志的實際操作流程,下面就是文章的詳細內(nèi)容的講述。

此文文章主要向大家講述的是MySQL5 master slave安裝與配置日志的實際操作步驟,首先我們是從MySQL5 master slave安裝與配置日志的背景開始講起的,下面就是文章的主要內(nèi)容的具體描述。

MySQL5 master slave安裝配置日志背景:

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ù)庫)
binlog_do_db = test

并確保

server-id=1

log-bin=MySQL(和PHP搭配之最佳組合)-bin

step2) 授權slave

 

  1. 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線程不工作

報了很怪的錯誤

 

  1. 070307 16:30:27 [ERROR] Slave: Error 'Table 'passport.  
  2. loginuser' doesn't exist' on query. Default database: 'passport'.   
  3. Query: 'delete from loginuser where tokenRefreshTime<='2006-07-03 07:00:00'', Error_code: 1146  
  4. 070307 16:30:27 [ERROR] Error running query,   
  5. slave SQL thread aborted. Fix the problem,   
  6. and restart the slave SQL thread with "SLAVE START".   
  7. We stopped at log 'MySQL(和PHP搭配之最佳組合)-bin.000001' position 98  

MySQL5 master slave安裝配置日志中因該是relay log中的數(shù)據(jù)有問題,于是在

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

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

replicate-do-db=test

重啟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ù)多此一舉,于是

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

【編輯推薦】

  1. 使用PHP+MySQL來對圖書管理系統(tǒng)進行構建
  2. MySQL數(shù)據(jù)庫文件壞掉,不用急!
  3. MySQL 5 中易忘的使用性較強的命令
  4. 實現(xiàn)MySQL定時執(zhí)行并不難!
  5. 巧用c# 連接MySQL中文亂碼問題
責任編輯:佚名 來源: 博客園
相關推薦

2010-05-13 16:15:21

MySQL5 mast

2010-06-11 16:16:59

2010-06-10 13:19:15

2010-06-12 10:10:55

2010-06-12 17:06:44

2010-06-09 13:55:24

設置MySQL同步

2010-05-19 16:45:26

MySQL自動啟動

2010-06-13 17:20:58

MySQL maste

2010-05-19 16:10:49

MySQL連接數(shù)

2010-10-08 14:29:21

ASA防火墻

2010-06-13 16:09:28

MySQL maste

2010-09-07 11:14:56

DB2配置向?qū)?/a>

2010-06-12 15:46:56

MySQL5

2010-06-04 09:58:03

MySQL數(shù)據(jù)庫備份

2010-06-09 11:32:51

MySQL數(shù)據(jù)庫備份

2010-05-11 19:02:24

MySQL5 綠色版

2010-06-11 16:46:20

MySQL5

2011-04-06 09:39:49

mysql5存儲

2019-12-13 09:48:48

開源技術 軟件

2010-10-09 16:51:47

點贊
收藏

51CTO技術棧公眾號