mysql - CloudSQL 只读副本 - 无法执行停止从属,跳过命令
问题描述
我的复制卡在了一些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 上的 root 用户没有SUPER 权限,因此您不能使用 stop slave 命令,因为它需要它。您可以随时使用GCP UI上的“DISABLE REPLICATION”停止复制。
如果复制在此过程中停止(或卡住),您在问题跟踪器上打开一个问题,我们也许可以从我们这边进行调查。
推荐阅读
- c# - 如何在 Azure 应用服务中显示用户友好的错误
- python - 如何将 .pyc 文件编译为 .exe 文件?我不能使用 auto-py-to-exe 或 pyinstaller,因为它们不接受字节
- xml - BizTalk 需要两次由 PowerShell 脚本保存的 XmlDocument
- docker-compose - docker-compose 不等待依赖
- javascript - #text 节点上的 outerHTML/innerHTML
- laravel - 如何使用 laravel 惯性和 vue.js 更新表记录
- python - 如何使用 python 自动将现有意图列表中的意图添加到现有 AWS LEX BOT
- pyspark - Pyspark:如何在多列上连接两个数据框?
- mysql - 无法在 Mysql 和 Express Node JS 中转义限制值
- jupyter-notebook - 构建失败,出现 500,请在服务器上运行“jupyter lab build”以获得 Jupyter lab 中的完整输出