show|show master status 时没有数据显示

为什么80%的码农都做不了架构师?>>>show|show master status 时没有数据显示
文章图片

环境:
系统:centos 4.8 (64位)
yum安装的mysql数据库。
今天做mysql主从时,查看master日志时没有数据显示,
mysql> show master status;
Empty set (0.00 sec)
mysql>
从网上搜了一下说是master数据库没有启动 show|show master status 时没有数据显示
文章图片
master status 时没有数据显示" title="show master status 时没有数据显示" width="22" height="22"> 最后终于弄出来了,
用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> 【show|show master status 时没有数据显示】转载于:https://my.oschina.net/neo600/blog/136994

    推荐阅读