第一步:开启所有MYSQL服务器的BIN日志,每台服务器设置一个唯一的server-id的值(默认是1,一般取IP最后一段)修改主服务器(master)的my.cnf[mysqld]log-bin=mysql-binserver-id=91修改从服务器(slave)的my.cnf[mysqld]lo...
分类:
数据库 时间:
2015-02-28 14:20:15
阅读次数:
198
MySQL 主从复制搭建1. 搭建1.1 MasterMaster配置(my.cnf)[mysqld]log-bin=/usr/local/mysql-5.6.16/log/mysql-binserver_id=1启动Master./bin/mysqld_safe --defaults-file=/...
分类:
数据库 时间:
2015-02-18 17:34:20
阅读次数:
285
直接运行一下代码就可以:
log-error=log-error.log
log=log.log
log-bin=log-bin.log
log-queries-not-using-indexes=log-queries-not-using-indexes.log
log-warnings=1
log-slow-queries=log-slow-query.log
log-u...
分类:
数据库 时间:
2015-02-14 12:26:22
阅读次数:
152
实验环境:centos6.6mariaDB10.0.10二进制安装这里不再说明安装过程直接开始配置主从节点节点1:172.16.30.1[root@node1~]#vim/etc/mysql/my.cnf
thread_concurrency=4
datadir=/mydata/data#数据库存放目录
innodb_file_per_table=1##innodb引擎单表单文件
log-bin=/mydata/bi..
分类:
数据库 时间:
2015-02-11 02:00:46
阅读次数:
182
修改/etc/my.cnf下面四个配置,没有的话就加入这四个。log-bin=mysql-binbinlog_format=mixedexpire_logs_days=7binlog-do-db=your_db查看binlogmysqlbinlog --no-defaults mysql-bin.0...
分类:
数据库 时间:
2015-02-09 17:49:41
阅读次数:
156
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
查了一些资料,解决办法是把log_bin_trust_function_cr...
分类:
数据库 时间:
2015-02-05 18:33:40
阅读次数:
220
一、二进制日志简介MySQL有不同类型的日志,其中二进制文件记录了所有对数据库的修改,如果数据库因为操作不当或其他原因丢失了数据,可以通过二进制文件恢复。在my.ini文件中设置了log-bin,重新启动MySQL后就开启了二进制日志。数据库每次重新启动(或执行flush logs命令)后,都会生成...
分类:
数据库 时间:
2015-02-05 14:52:43
阅读次数:
228
找到my.ini(Linux下是my.cnf)文件,在文件里加入下面两行:log="F:/mysqllog/mysql.log"log-bin="F:/mysqllog/logbin.log"重新启动MySQL服务,即开启了log和log_bin日志。
分类:
数据库 时间:
2015-01-31 16:04:07
阅读次数:
154
1.环境说明:DBmaster:172.16.1.55DBslave:172.16.1.562.Server-id配置(/etc/my.cnf):主库配置server-id要比从库的ID校主库ID设置:Server-id=55从库ID设置:Server-id=563.日志格式设置(/etc/my.cnf):log-bin=mysql-bin(主库、从库都设置)4.主库授权从库的权限设置:grant..
分类:
数据库 时间:
2015-01-20 18:22:50
阅读次数:
298
mysql中日志类型有慢查询日志,二进制日志,错误日志,默认情况下,系统只打开错误日志,因为开启日志会产生较大的IO性能消耗。一般情况下,生成系统中很少打开二进制日志(bin log),bin log日志的优化策略:mysql> show variables like '%binlog%';+---...
分类:
数据库 时间:
2015-01-16 18:38:26
阅读次数:
263