Sachin
Sachin

Reputation: 18757

Can we get a read-only connection to MySQL Server? Or set autocommit to false by default?

Recently a colleague of mine messed up with one of our databases. Hence I would like to know that is there a way to get a read-only connection to the MySQL Server from the MySQL Workbench? If not, is there a way by which we can set the autocommit to false (0) by default?

EDIT: The problem is sometimes the same user has to make some modifications to the DB and also, I am not the System Admin to change such permissions. :) This sort of mess up happens when we are working with development environment, but due to some reason open a connection to production environment, say to have a look at a table or data in a table, and then just forget to switch back to development tab.

Upvotes: 2

Views: 3260

Answers (2)

tlancaster
tlancaster

Reputation: 11

Create two users for two seperate connections. The connection that is normally used would have read only access. The other would be used only when making edits, then disconnected immediately. Not foolproof, but then again, nothing is.

Upvotes: 1

Paul Sonier
Paul Sonier

Reputation: 39490

Set the permissions on the user that will be used to not have UPDATE / INSERT permissions.

Upvotes: 2

Related Questions