欢迎来到天天文库
浏览记录
ID:52927877
大小:189.18 KB
页数:7页
时间:2020-04-01
《mysql51双机热备记录.pdf》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、MYSQL双机备份记录李新君1版本说明Mysql:5.1.56,Fedora10;A:192.168.1.200B:192.168.1.2012创建数据库首先在A机器创建要备份的数据库和表,然后用mysqldump导出并在B机器部署,保证两台机器数据库、表、数据等都一致;然后对两个数据库用户进行授权,保证双方可以正常访问;A机器:mysql>grantallonbackup.*to'backup'@'192.168.1.201'identifiedby'backup'withgrantoption;mysql>granta
2、llonbackup.*to'backup'@'localhost'identifiedby'backup'withgrantoption;mysql>flushprivileges;B机器:mysql>grantallonbackup.*to'backup'@'192.168.1.200'identifiedby'backup'withgrantoption;mysql>grantallonbackup.*to'backup'@'localhost'identifiedby'backup'withgrantoption;
3、mysql>flushprivileges;3数据库配置文件修改安装过程略:A服务器my.cnf:B服务器my.cnf:####==============================####==============================#####synchronizationconfigstart####synchronizationconfigstart#####==============================####==============================#Maste
4、rIP:192.168.1.200#MasterIP:192.168.1.200##SlaveIP:192.168.1.201#SlaveIP:192.168.1.201##synchronizationdatabase:backup#synchronizationdatabase:backup##user:backuppassword:backup#user:backuppassword:backupserver-id=1server-id=2binlog-do-db=backupbinlog-do-db=backupl
5、og-binlog-binmax_binlog_size=104857600max_binlog_size=104857600replicate-same-server-idreplicate-same-server-id#========================#========================###undersettingslave##undersettingslave###========================##========================master-host
6、=192.168.1.201master-host=192.168.1.200master-user=backupmaster-user=backupmaster-password=backupmaster-password=backupmaster-port=3306master-port=3306master-connect-retry=60master-connect-retry=60replicate-do-db=backupreplicate-do-db=backupbinlog-ignore-db=mysqlb
7、inlog-ignore-db=mysql#log-slave-updateslog-error=/var/log/mysqld.loglog-error=/var/log/mysqld.log###============================###===========================####synchronizationconfigend###synchronizationconfigend####===========================###=================
8、===========4备份授权A服务器授权mysql>grantreplicationslaveon*.*to'backup'@'192.168.1.201'identifiedby'backuppwd';mysql>flushprivileges;B服务器授权mysql>grantreplicati
此文档下载收益归作者所有