2014-03-21 18:42 GMT+01:00 David Lerer <dlerer@stripped>:
> Frequently, we import a production dump that contains only 1 or 2
> databases into one of our QA instances that contains many more databases.
> (i.e. "database" being a "schema" or a "catalogue).
> At the beginning of the import script, we first drop all objects in the QA
> database so that it will be a perfect match (object wise) to production.
> Is there an easy way to lock the whole database for the duration of the
> import - so that no developers can update the database?
> Obviously, I can revoke permissions, but I was wondering whether there is
> a better approach.
One more idea:
Assuming you can stop your DB - restart the database so it only listens in
the unix socket or in a different IP (an alias of your current IP could
work) and connect thru it do all your stuff and enabled it back to its
original port and IP.
Obviously I am assuming your developers connect remotely (thru port 3306 or
whichever you use).