環境: 系統:centos 4.8 (64位) yum安裝的mysql數據庫。 今天作mysql主從時,查看master日誌時沒有數據顯示, mysql> show master status; Empty set (0.00 sec) mysql> 從網上搜了一下說是master數據庫沒有啓動 最後終於弄出來了, 用yum安裝的mysql數據庫/etc/my.cnf文件只是知足基本要求, 如: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 server-id = 130 [mysqld_safe] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 在/etc/my.cnf文件中添加一行 log-bin=mysql-bin 而後重啓mysql數據庫便可; mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000001 | 79 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)