show master status 时没有数据显示
(2011-09-30 20:48:50)
标签:
杂谈 |
分类: MYSQL |
环境:
系统:centos 4.8 (64位)
yum安装的mysql数据库。
今天做mysql主从时,查看master日志时没有数据显示,
mysql> show master status;
Empty set (0.00 sec)
mysql>
从网上搜了一下说是master数据库没有启动http://www/uc/myshow/blog/misc/gif/E___6687EN00SIGG.gifmasterstatus 时没有数据显示" TITLE="show master status 时没有数据显示" />
最后终于弄出来了,
用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)
mysql>
从网上搜了一下说是master数据库没有启动http://www/uc/myshow/blog/misc/gif/E___6687EN00SIGG.gifmaster
用yum安装的mysql数据库/etc/my.cnf文件只是满足基本要求,
如:
在/etc/my.cnf文件中添加一行
然后重启mysql数据库即可;
mysql> show master status;
+------------------+----------+--------------+------------------+
| File
+------------------+----------+--------------+------------------+
| mysql-bin.000001 |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
mysql>