windows下MySQL master-slave
MySQL 復制設置
- Set up MySQL replication and control slave thread
MySQL主從備份
推薦圈子: Database圈子
更多相關推薦 假設安裝過一個MySQL
1.先安裝2個MySQL 其實也就是復制一個MySQL master-slave)
2.修改端口號和安裝地址(my.ini) 這裡我們不使用默認端口3306 主要測試
Xml代碼
- MySQL5.1
- [client]
- port=3307
- [MySQLd]
- port=3307
- basedir="E:/MySQL5.1/"
- datadir="E:/MySQL5.1/Data/"
- MySQL5.2
- [client]
- port=3308
- [MySQLd]
- port=3308
- basedir="E:/MySQL5.2/"
- datadir="E:/MySQL5.2/Data/"
- MySQL5.1
- [client]
- port=3307
- [MySQLd]
- port=3307
- basedir="E:/MySQL5.1/"
- datadir="E:/MySQL5.1/Data/"
- MySQL5.2
- [client]
- port=3308
- [MySQLd]
- port=3308
- basedir="E:/MySQL5.2/"
- datadir="E:/MySQL5.2/Data/"
3.在Master(MySQL5.1)的數據庫中建立一個備份帳戶,命令如下
Sql代碼
- GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';
- GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';
以上的相關內容就是對windows下MySQL master-slave的介紹,望你能有所收獲。