[talk] Databases

Edward Capriolo edlinuxguru at gmail.com
Mon Oct 17 11:46:30 EDT 2016


On Mon, Oct 17, 2016 at 11:40 AM, Sujit K M <kmsujit at gmail.com> wrote:

> On Mon, Oct 17, 2016 at 7:57 AM, N.J. Thomas <njt at ayvali.org> wrote:
> > * Sujit K M <kmsujit at gmail.com> [2016-10-15 18:42:05+0530]:
> >> I was recently looking at databases or infact user who are readonly. I
> >> wanted to know whether MySQL on FreeBSD happens to have a write
> >> configuration which lets you disable the write part totally.
> >
> > If I understood you correctly, I think what you want is to create a user
> > and grant them only read permissions. Here's the syntax for the GRANT
> > command:
> >
> >     http://dev.mysql.com/doc/refman/5.7/en/grant.html
> >
> > You can do this at the database or table level.
>
> I was more interested in making the mysql server itself readonly. The
> below link
> suggested something but I haven't verified it as of yet. I also find
> Slaves being
> made readonly though not currently advisable in production.
>
> https://dev.mysql.com/doc/refman/5.6/en/innodb-read-only-instance.html
>
> My set of thinking on is on the below lines.
> "If we make an Database read only then we need to return 0 in the case of
> Insert/Update statements", 0 being the number of records which are
> inserted.
>
> _______________________________________________
> talk mailing list
> talk at lists.nycbug.org
> http://lists.nycbug.org/mailman/listinfo/talk
>

I was not exactly sure what you meant here. I can think of a few options:

1) Use mysql-proxy. https://downloads.mysql.com/archives/proxy/ You need to
do a little bit of coding do do exactly what you want, but many people have
expressed they use it to route queries based on application logic.

2) Setup a user that only has SELECT priv.

3) Creative replication: You can use things like the blackhole-storage
engine in your replication chain.
http://dev.mysql.com/doc/refman/5.7/en/blackhole-storage-engine.html
I do not know exactly how to get at a read only DB using blackhole but you
might come up with something that works for you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nycbug.org:8443/pipermail/talk/attachments/20161017/3b723910/attachment.htm>


More information about the talk mailing list