dannydudek
asked on
How to make MySQL Slave "read-only"?
Hi All,
I have setup master-slave MySQL replication, which works great, however I would like to make sure, that slave database cannot be modified. Is there any way i could make it "read-only"?
I was thinking about changing users permission on the slave, however that could cause break in replication (the entire server is replicated).
I have setup master-slave MySQL replication, which works great, however I would like to make sure, that slave database cannot be modified. Is there any way i could make it "read-only"?
I was thinking about changing users permission on the slave, however that could cause break in replication (the entire server is replicated).
ASKER
I actually read that, but this way the replication stops, and is read only not only to users, but also to master.
Ok, let me undestand what you want here. Let's see if I understand correctly:
1. Master - Slave replication
2. Master push all the queries to Salve
3. You want to block the update/delete/insert/creat
But then this is not replication anymore!
If the Master gets an insert then it pushes that to the Slave and
the slave rejects it. Then the databases are not the same anymore.
The replica contains less data.
Or you want to just block update/delete??!
But then again your replica is not the same as the one you have on master!!
So which one is it?
Cheers,
za-k/
ASKER
I want slave to be up to date with master, but i want to make sure that users cannot modifiy anything on the slave.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Isn't http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_read_only what you're looking for?
If so, place "read_only" on a line (by itself) under [mysqld] on your slave's my.cnf
If so, place "read_only" on a line (by itself) under [mysqld] on your slave's my.cnf
Have a look here:
http://dev.mysql.com/doc/refman/5.1/en/replication-solutions-backups-read-only.html
Cheers,
za-k/