简体   繁体   English

AWS Aurora:MySQL 服务器正在使用 --read-only 选项运行,因此无法执行此语句

[英]AWS Aurora: The MySQL server is running with the --read-only option so it cannot execute this statement

I am getting this error when executing a GRANT statement on my Aurora DB instance in AWS:在 AWS 中对我的 Aurora 数据库实例执行GRANT语句时出现此错误:

The MySQL server is running with the --read-only option so it cannot execute this statement MySQL 服务器以--read-only 选项运行,因此无法执行此语句

My user is not read-only though, so why is this happening?虽然我的用户不是只读的,但为什么会发生这种情况?

It turned out to be a silly mistake, but posting it anyway in case anyone else has the problem: 事实证明这是一个愚蠢的错误,但无论如何发布它以防其他人有问题:

I was accessing the replica instance by mistake - I had copied the endpoint for the replica, and it is read-only apparently. 我错误地访问了副本实例 - 我复制了副本的端点,它显然是只读的。 So if you have this problem, verify that you are connecting to the Primary Instance or best of all the DB Cluster endpoint. 因此,如果您遇到此问题,请验证您是连接到主实例还是连接到所有数据库群集端点。

Edit: According to @Justin's answer we definitely should use DB Cluster: 编辑:根据@ Justin的回答,我们肯定应该使用DB Cluster:

You need to connect to the cluster, rather than an instance. 您需要连接到群集,而不是实例。 This is because instances seem to take a turn to be the readers and writers. 这是因为实例似乎转而成为读者和作家。

You need to connect to the cluster , rather than an instance . 您需要连接到群集 ,而不是实例 This is because instances seem to take a turn to be the readers and writers. 这是因为实例似乎转而成为读者和作家。

In my case, I was receiving this error after performing a Blue/Green failover in a Test environment.就我而言,我在测试环境中执行蓝/绿故障转移后收到此错误。 I was trying to access the Blue database, in order to confirm the process for reverting back to Blue database should that be required later.我试图访问 Blue 数据库,以确认在以后需要时恢复到 Blue 数据库的过程。

Accessing Blue via the cluster address yielded this error, as did attempting to use the direct links to the Blue "reader" and "writer" instances.通过集群地址访问 Blue 产生了这个错误,尝试使用直接链接到 Blue 的“reader”和“writer”实例也是如此。 In the end, I performed a failover of the Blue "reader" and "writer" instances, after which the cluster address was in a working state again.最后,我执行了蓝色“读取器”和“写入器”实例的故障转移,之后集群地址再次处于工作状态 state。

tl;dr tl;博士

Try a failover of the "writer".尝试对“编写器”进行故障转移。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .net6.0 - 向前写入 - AWS Aurora:MySQL 服务器正在使用 --read-only 选项运行,因此它无法执行此语句 - .net6.0 - write forward - AWS Aurora: The MySQL server is running with the --read-only option so it cannot execute this statement MySQL 服务器以--super-read-only 选项运行,因此无法执行此语句 - The MySQL server is running with the --super-read-only option so it cannot execute this statement MYSQL 错误代码:1290 - MySQL 服务器正在使用 --secure-file-priv 选项运行,因此无法执行此语句 - MYSQL Error Code: 1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement 如何处理 MySQL 服务器使用 --secure-file-priv 选项运行,因此它无法在 Mac 上执行此语句 - How to deal with The MySQL server is running with the --secure-file-priv option so it cannot execute this statement on a Mac 错误代码:1290。MySQL 服务器正在使用 --secure-file-priv 选项运行,因此无法执行此语句 - Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement 如何在 AWS 的 Aurora MySQL 数据库中将写入和读取端点更改为只读? - How can I change write and read endpoint to read-only in Aurora MySQL database in AWS? AWS Aurora MySQL 准备好的声明 - AWS Aurora MySQL prepared statement Amazon Aurora是否为在从属节点上运行的只读事务提供可序列化隔离? - Does Amazon Aurora offer serializable isolation for read-only transaction running on slave nodes? MySQL shell / client:只读访问权限,还是“安全历史记录”选项? - MySQL shell/client: Read-only access, or “safe history” option? 有没有办法将 Aurora 写入器实例设置为只读? - Is there a way to set an Aurora writer instance read-only?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM