码迷,mamicode.com
首页 > 数据库 > 详细

mysql

时间:2018-06-12 00:12:18      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:mysql

cd /root/soft/mysql
tar -xf mysql-5.7.17.tar
yum -y install perl-JSON
rpm -Uvh mysql-community-*.rpm
systemctl start mysqld
systemctl enable mysqld
grep password /var/log/mysqld.log
mysql -hlocalhost -uroot -p‘

set global validate_password_policy=0;
set global validate_password_length=6;
alter user root@"localhost" identified by"123456";
quit
vim /etc/my.cnf
systemctl restart mysqld

启用binlog日志 做用户授权 show master status;
指定server_id 指定主数据库服务器的信息 启动slave进程
server_id=76
validate_password_policy=0
validate_password_length=6
log-bin=master73
binlog-format="mixed"
grant replication slave on . to yaya@"%" identified by "123456";
show master status;显示当前正在使用的binlog日志信息

change master to
master_host="192.168.4.62",
master_user="yaya",
master_password="123456",
master_log_file="master62.000001",
master_log_pos=154;
start slave;
reset master ;删除所有的日志文件重新生成第一个日志文件

select user,host from mysql.user where user="yaya";
update mysql.user set account_locked="Y" where user= ‘root‘ and host=‘localhost‘; flush privileges;

mysql

标签:mysql

原文地址:http://blog.51cto.com/13735155/2128218

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!