摘要: 一,基本步骤1,创建在主从数据上都创建复制账号,权限选上super, replication slave , replication master(选上这个可以方便从库变成主库);2,配置主库和备库配置文件 /etc/my.cnf#masterlog_bin = mysql_binserver_id = 101 #unique id , 可以是Ip的最后几位#slavelog_bin = mysql_bin #和上面一致server_id = 102relay_log = /var/lib/mysql/mysql-relay-binlog_slave_updates = 1 read_only 阅读全文
posted @ 2013-11-14 10:28 ifeixiang 阅读(673) 评论(0) 推荐(0) 编辑
摘要: mysql -uroot -p#input password use mysql;update user set host='%' where user='root';flush privileges;#ok密码root密码也可以改:先停止正在运行的mysql实例,在配置文件/etc/my.cnf里面加入skip-grant-tables, 重新启动Mysql或者使用bin/safe_mysqld --skip-grant-tables & 启动使用 mysql -u root 连接(现在已经可以无密码连接了)update user set passwo 阅读全文
posted @ 2013-11-14 10:04 ifeixiang 阅读(1691) 评论(0) 推荐(0) 编辑