# SUPER allows writing read-only slave for some users, but not the others

**URL:** <https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746>\
**Category:** Other MySQL® Questions\
**Created:** [December 17, 2018, 7:30pm UTC](https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746 "2018-12-17T19:30:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![milosb](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@milosb](https://forums.percona.com/u/milosb)\
**Post date:** [December 17, 2018, 7:30pm UTC](https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746/1 "2018-12-17T19:30:32Z")

</div>

I have a replication slave configured with read-only on server start up, and a table that needs writing on this slave only. To that end, I’ve created a user with the following privileges:

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON slave\_only\_wr.\* TO ‘slave\_only\_wr’@‘%’;  
GRANT SUPER on _._ TO ‘slave\_only\_wr’@‘%’;

The ‘slave\_only\_wr’ database and user are created on the replication master, as is where the privileges were given, and flushed. And the tables in this DB exist on the slave only - which is where they should be written to. The user created specifically for this purpose, ‘slave\_only\_wr’ can write slave\_only\_wr.\*, no problem, but, if I grant the above privileges to a pre-existing user (e.g. ‘app\_user’@‘%’ who already has ~50 other privileges, not including SUPER until now), and try writing the database or its tables, I keep getting:

ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

I’m running out of ideas what may be causing this. Could this happen if the pre-existing user was created just by issuing GRANT … ON … TO…;, instead of running CREATE USER …? Granting the above privileges to ‘app\_user’@‘hostame’ gives the desired effect.

Any ideas would be very appreciated.

---

<div class="post-metadata">

**Author:** ![milosb](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@milosb](https://forums.percona.com/u/milosb)\
**Post date:** [December 18, 2018, 7:39am UTC](https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746/2 "2018-12-18T07:39:29Z")

</div>

Update: Because I was connecting to the replication slave locally (i.e. -h localhost implies), and there already was a ‘app\_user’@‘localhost’ defined, to whom the SUPER privilege was never granted, the user/privilege earlier assigned was never evaluated because @‘localhost’ is a closer match.

---

<div class="post-metadata">

**Author:** ![lorraine.pocklington](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lorraine.pocklington/32/37_2.png) [@lorraine.pocklington](https://forums.percona.com/u/lorraine.pocklington)\
**Post date:** [December 18, 2018, 7:40am UTC](https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746/3 "2018-12-18T07:40:48Z")

</div>

Thanks for that update, it could be very useful to another reader. Are you all good now?

---

<div class="post-metadata">

**Author:** ![milosb](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@milosb](https://forums.percona.com/u/milosb)\
**Post date:** [December 18, 2018, 7:45am UTC](https://forums.percona.com/t/super-allows-writing-read-only-slave-for-some-users-but-not-the-others/6746/4 "2018-12-18T07:45:33Z")

</div>

Yes, thanks. This issue is resolved.
