MySQL复制中启动从库,日志中提示用户名及密码问题
2016-08-28 00:00
447 查看
摘要: MySQL复制中的错误日志中提示
[Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommmended.Please consider using the USER and PASSWORD connection options for START SLAVE;see the 'START SLAVE Syntax'......
重现模拟环境:
1.在主库上创建复制账户
create user repl ;
grant replication slave , replication client on *.* to repl@'192.168.6.16' identified by 'repl';
2.建库建表、插入数据
use test;
create table t(id int);
insert into t values(1),(2);
3.dump主库数据
mysqldump -uroot -p -S /data/mysql5.6_data/mysql.sock --lock-tables -R -E --triggers --master-data=2 -A > ./all.sql
scp all.sql mysql@192.168.6.16:/home/mysql
4.在主库上插入数据,模拟数据是否同步过来。
/app/mysql5.6/bin/mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
use test;
insert into t values(3),(4);
flush logs;
insert into t values(5),(6);
5.将主库dump的数据恢复到从库
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock < ./all.sql #从库上操作
6.在从库上开启复制
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
change master to master_host='192.168.6.15',master_user='repl',master_password='repl',MASTER_LOG_FILE='binlog.000003', MASTER_LOG_POS=743;
#主库的binlog及pos可以在dump的文件中可以找到
start slave;
show slave status\G;
7.在从库上查看数据
use test;
select * from t;
当我们查看slave的错误日志:
会出现如下提示信息:
[Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
1.我们停到从库的复制线程
stop slave;
2.在主库上插入数据 // 模拟主库同时在写。
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
use test;
insert into t values(7),(8);
3.开启从库复制线程。
start slave user='repl' password='repl';
SHOW SLAVE STATUS\G;
use test;
select * from t;
[Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommmended.Please consider using the USER and PASSWORD connection options for START SLAVE;see the 'START SLAVE Syntax'......
重现模拟环境:
1.在主库上创建复制账户
create user repl ;
grant replication slave , replication client on *.* to repl@'192.168.6.16' identified by 'repl';
2.建库建表、插入数据
use test;
create table t(id int);
insert into t values(1),(2);
3.dump主库数据
mysqldump -uroot -p -S /data/mysql5.6_data/mysql.sock --lock-tables -R -E --triggers --master-data=2 -A > ./all.sql
scp all.sql mysql@192.168.6.16:/home/mysql
4.在主库上插入数据,模拟数据是否同步过来。
/app/mysql5.6/bin/mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
use test;
insert into t values(3),(4);
flush logs;
insert into t values(5),(6);
5.将主库dump的数据恢复到从库
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock < ./all.sql #从库上操作
6.在从库上开启复制
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
change master to master_host='192.168.6.15',master_user='repl',master_password='repl',MASTER_LOG_FILE='binlog.000003', MASTER_LOG_POS=743;
#主库的binlog及pos可以在dump的文件中可以找到
start slave;
show slave status\G;
7.在从库上查看数据
use test;
select * from t;
当我们查看slave的错误日志:
会出现如下提示信息:
[Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
1.我们停到从库的复制线程
stop slave;
2.在主库上插入数据 // 模拟主库同时在写。
mysql -uroot -p -S /data/mysql5.6_data/mysql.sock
use test;
insert into t values(7),(8);
3.开启从库复制线程。
start slave user='repl' password='repl';
SHOW SLAVE STATUS\G;
use test;
select * from t;
相关文章推荐
- innodb表文件直接复制出现不能启动mysql和mysql不支持innodb的问题
- mysql启动提示mysql.host 不存在,启动失败【问题已经解决】
- 解决启动WebLogic输入用户名密码问题
- 解决启动WebLogic输入用户名密码问题
- Delphi使用ADOConnection每次启动程序都提示输入用户名和密码
- MySQL日志误删后启动问题
- MySQL用户名和密码问题
- Wowza推RTSP流提示要求用户名密码 的问题解决
- mysql 的启动、修改密码等问题汇总
- 注册时提示用户名小于3或者密码不匹配问题的临时办法
- 解决启动WebLogic输入用户名密码问题
- netbeans下调试j2me,出现提示要tomcat的manager权限的用户名和密码问题解决位置
- QC安装过程中数据库连接问题与用系统用户时总是提示用户名密码不正确
- mysql常用命令+解决mysql不用用户名和密码可以直接登陆的问题
- SPS2007 的备用映射域名登陆时提示输入用户名和密码的问题
- 去掉系统启动时提示输入用户名及密码 ,Windows XP自动登录设置方法(转)
- mysql主主模式无法启动日志同步进程问题处理
- 如运行程序提示:“没有找到libmysql.dll,因此这个应用程序未能启动。重新安装应用程序可能会修复此问题。
- 解决启动WebLogic输入用户名密码问题
- 复制mysql数据目录后无法启动的问题