read-only mode

dbuser297 posted 3 years ago in General
Is there really no option to mark some databases or tables as read-only after opening HeidiSQL or even to open HeidiSQL in read-only mode (i.e., everything is read-only)?
jfalch posted 3 years ago
ansgar posted 3 years ago
Well, you can do that very effectively by restricting your user privileges in that database to SELECT. That is not an option in HeidiSQL itself.
doomy posted 3 months ago

In my case I don't administrate the db users myself. I guess I could ask for the write privileges to be revoked from my user, but there's a good chance I will need those ocasionally. Typically though I don't need the rights, and it would be really great to have an application-level safety mechanism to prevent me from changing something unintentionally.

ansgar posted 3 months ago

Well, I could add a checkbox to the session manager's advanced tab, namely "Read only mode" or so. If activated, what happens then? I'd say

  • grid editing should be blocked with an error message
  • the "save" buttons on the table editor should always be displaying the same error instead of saving changes.
  • same goes for the views, procedures, events and triggers.
  • the "ok" button on the edit/create database dialog should display that error message
  • same for the user manager's ok button
  • same goes for the "ok" button on the CSV import dialog
  • same goes for the "ok" button on the "import files into blobs" dialog
  • same goes for the "execute" button in tools > Maintenance
  • same goes for the "execute" button in tools > SQL export, if output is database or server
  • query tabs will be a problem. Simple queries starting with UPDATE, INSERT or DELETE could be blocked, but complex queries with subqueries and so on cannot be really parsed by HeidiSQL for detecting write operations. So that would be still left up to the user.

This is a whole bunch of changes for a non-reliable feature, huh?

kaizhou posted 3 weeks ago


I use HeidiSQL a lot. And in the past 6 months, I've made 2 accidental modification to DB. For the 1st time I accidently double clicked on a row, edited its data to other value, and when I move mouse cursor away, it updated the DB. For the 2nd time, I accidently hit Ctrl+C, Ctrl+V while my mouse focus was in select result, ending up inserting a new row to database.

I understand a readonly mode may be too complex. So maybe a confirmation promp mode would help. In that mode, all modifications to DB will prompt a Message box, saying "Do you want to make this chagge to database?"

This will greatly reduce the chance of accidental user mistake.

An alternative solution, maybe just allow user to disable edit via select result panel will do.

Regards, Kai

Please login to leave a reply, or register at first.