二:修改主库my.cnf文件如下,注意红色字体部分,重启数据库实例
- [root@dg53 ~]# grep -v '^#' /etc/my.cnf |grep -v '^$'
- [client]
- port = 3306
- socket = /tmp/MySQL.sock
- [mysqld]
- port = 3306
- socket = /tmp/mysql.sock
- skip-external-locking
- key_buffer_size = 256M
- max_allowed_packet = 1M
- table_open_cache = 256
- sort_buffer_size = 1M
- read_buffer_size = 1M
- read_rnd_buffer_size = 4M
- myisam_sort_buffer_size = 64M
- thread_cache_size = 8
- query_cache_size= 16M
- thread_concurrency = 8
- innodb_data_home_dir =
- innodb_data_file_path = /dev/raw/raw6:1Graw
- log-bin=mysql-bin
- binlog_format=mixed
- server-id=1
- log-bin=mysql-bin
- binlog-do-db=bbs
- binlog-do-db=test
- binlog-ignore-db=mysql
- [mysqldump]
- quick
- max_allowed_packet = 16M
- [mysql]
- no-auto-rehash
- [myisamchk]
- key_buffer_size = 128M
- sort_buffer_size = 128M
- read_buffer = 2M
- write_buffer = 2M
- [mysqlhotcopy]
- interactive-timeout
- [root@dg53 ~]# service mysqld restart
- Shutting down MySQL.[ OK ]
- Starting MySQL..[ OK ]
- [root@dg53 ~]# mysql
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 1
- Server version: 5.5.25-log Source distribution
- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show master status;
- +------------------+----------+--------------+------------------+
- | File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
- +------------------+----------+--------------+------------------+
- | mysql-bin.000011 | 107 | bbs,test | mysql |
- +------------------+----------+--------------+------------------+
- 1 row in set (0.00 sec)
