Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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