Take the 2-minute tour ×

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

1 Answer

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

Your Answer

