为什么我的 Slave 无法在 MYSQL 上启动?
mysql> start slave;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings;
+-------+------+--------------------------+
| Level | Code | Message |
+-------+------+--------------------------+
| Note | 1254 | Slave is already running |
+-------+------+--------------------------+
1 row in set (0.00 sec)
mysql> show slave status\G;
Empty set (0.00 sec)
ERROR:
No query specified
为什么????我全新安装了 MYSQL。我编辑了 My.cnf。然后我又重新开始了那些该死的事情。
这是我的奴隶 MY.CNF
server-id = 2
log_bin = /var/log/mysql/mysql-bin.log
master-host = 68.13.41.41
master-user = replication
master-password = slave
master-port = 3306
这是我的主人 MY.cnf:
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog-do-db=fal
我在主人上做了这个:
GRANT ALL ON *.* TO 'replication'@'theip' IDENTIFIED BY 'slave';
mysql> start slave;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings;
+-------+------+--------------------------+
| Level | Code | Message |
+-------+------+--------------------------+
| Note | 1254 | Slave is already running |
+-------+------+--------------------------+
1 row in set (0.00 sec)
mysql> show slave status\G;
Empty set (0.00 sec)
ERROR:
No query specified
Why???? I did a fresh install of MYSQL. I edited My.cnf. And I restarted the damn things.
This is my slave MY.CNF
server-id = 2
log_bin = /var/log/mysql/mysql-bin.log
master-host = 68.13.41.41
master-user = replication
master-password = slave
master-port = 3306
This is my master MY.cnf:
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog-do-db=fal
I did this on master:
GRANT ALL ON *.* TO 'replication'@'theip' IDENTIFIED BY 'slave';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我通过在 MYSQL 中运行命令来修复它(而不是依赖于配置)
I fixed it by running commands in the MYSQL thing (instead of relying on the config)
尝试将此行添加到 SLAVE 服务器上的 MY.CNF:
report-host = 68.13.41.41
然后在 SLAVE 服务器上重新启动 MySQL。
现在在 MASTER 服务器上测试:
SHOW SLAVE STATUS \G
Try adding this line to your MY.CNF on the SLAVE server:
report-host = 68.13.41.41
Then restart MySQL on the SLAVE server.
Now test on the MASTER server:
SHOW SLAVE STATUS \G
我猜您在语句末尾添加了一个分号 (;)。
\G 是不必要的。
因此将
show Slave status \G;
更改为show Slave status \G
I'm guessing you are adding a semi-colon (;) to the end of the statement.
Its unnecessary with the \G.
So change
show slave status \G;
toshow slave status \G