Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

The MySQL server is running with the --read-only option so it cannot execute this statement

My user is not read-only though, so why is this happening?

like image 559
sashoalm Avatar asked Oct 10 '17 11:10

sashoalm


People also ask

Is AWS Aurora compatible with MySQL?

Amazon Aurora is designed to be compatible with MySQL so that existing MySQL applications and tools can run without requiring modification.

Why am I getting a too many connections error when connecting to my Amazon Aurora MySQL instance?

If the client encounters a "Too Many Connections" error when you try to connect to an Amazon Aurora MySQL DB cluster or instance, this means that all available connections are in use by other clients.

Does Aurora have read replica by default?

When you create a second, third, and so on DB instance in an Aurora provisioned DB cluster, Aurora automatically sets up replication from the writer DB instance to all the other DB instances. These other DB instances are read-only and are known as Aurora Replicas.

What is the difference between MySQL and Aurora MySQL?

Aurora is intended for performance with cloud servers, while MySQL is designed to run on physical machines and may not be optimized for virtual machine performance. As a result, Amazon Aurora and MySQL performance will be affected by the nature of the machines the system is running on.


2 Answers

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:

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.

like image 189
sashoalm Avatar answered Sep 22 '22 02:09

sashoalm


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.

like image 44
Justin Lawrence Avatar answered Sep 23 '22 02:09

Justin Lawrence