我的复制卡在某些Last_SQL_Error
和Slave_SQL_Running: No
现在我想执行:
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;
但我不能:
- 无法阻止奴隶:
mysql> STOP SLAVE;
ERROR 1045 (28000): Access denied for user 'someuser'@'%' (using password: YES)
- 并且不能跳过:
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation.
用户是通过 Google Cloud Platform -> SQL -> 选择只读副本实例 -> 用户 -> 创建用户帐户创建的。
那里说:Users created by using the Cloud Console have the same privileges as the root user.
但它仍然没有超级特权(比我在常见问题解答中看到的要多(
Cloud SQL does not support SUPER privileges, which means that GRANT ALL PRIVILEGES statements will not work. As an alternative, you can use GRANT ALL ON `%`.*.
但它不起作用:
mysql> GRANT ALL ON `%`.* TO 'someuser'@'%' WITH GRANT OPTION;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement
那么,如何使复制再次工作呢?
由于 GCP SQL 上根用户没有 SUPER 权限,因此您不能使用 stop slave 命令,因为它需要它。您始终可以通过在 GCP UI 上使用"禁用复制"来停止复制。
如果复制在此过程中停止(或卡住(,您会在问题跟踪器上打开一个问题,我们也许可以从我们这边进行调查。