您的位置:首页 > 数据库 > MySQL

mysql 主从设置

2014-04-17 17:41 141 查看
导出mysqldump --single-transaction --skip-opt --create-option -F --master-data=2 -q -B -uroot game_release > game_rel0726.sql
数据库game_release,用户名密码:game/!123456'
db上设置
grant replication slave,replication client on *.* to game@'114.238.171.12' identified by '!123456';

dr上设置
create database game_release;
grant all privileges on game_release.* to game@'114.238.171.12' identified by '!123456';
mysql -uroot game_release --default-character-set=latin1 < game_release0722.sql
grant all privileges on game_release.* to game@'114.238.171.12' identified by '!123456';
FLUSH PRIVILEGES;
change master to master_host='114.238.171.12', master_user='game', master_password='!123456', master_log_file='mysql-bin.000039', master_log_pos=107;
FLUSH PRIVILEGES;
START SLAVE;

本文出自 “漫漫长路” 博客,请务必保留此出处http://ithelp.blog.51cto.com/4501237/1397395
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: