Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to create a read-only connection pool in Glassfish, talking to MySql, so that no updates are allowed? I want to have people use a replicated MySql database and I want to make sure no one tries to do updates.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Just give select only privileges to the user your app server connects as, so mysql will enforce that you can only select from the database, not update or delete anything.

You'd want to run something like this sql statement for that user,

grant select on thedb.* to 'myuser'@'host' identified by'thepassword';
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.