为什么我的 Slave 无法在 MYSQL 上启动?

发布于 2024-08-18 18:17:52 字数 1000 浏览 7 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

锦欢 2024-08-25 18:17:52

我通过在 MYSQL 中运行命令来修复它(而不是依赖于配置)

I fixed it by running commands in the MYSQL thing (instead of relying on the config)

何以畏孤独 2024-08-25 18:17:52

尝试将此行添加到 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

流云如水 2024-08-25 18:17:52

我猜您在语句末尾添加了一个分号 (;)。
\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; to show slave status \G

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文