MySQL does not have any SQL commands or internal mechanisms for
- making an individual database unavailable / offline
- moving an individual database
Thtis being the case, how can you take an individual database offline?
|
MySQL does not have any SQL commands or internal mechanisms for
Thtis being the case, how can you take an individual database offline? |
||||
|
|
What I am about to suggest is very high risk and never been tried. I suggest this simply because there is no SQL command in MySQL to rename a database. Since my suggestion will not harm the data, it is worth a shot.
Here it goes... SUGGESTIONSuppose
You could do something devious like this:
The database is accessible as From the standpoint of your app, To bring the database back online, do the following:
Unfortunately, it requires a shutdown and startup of mysql. I REPEAT
UPDATE 2012-11-30 18:09 EDTI will be giving the DBA.SE community about 4 weeks to see if there are other answers. If none is forthcoming, I will be attempt to script something using MySQL and/or Shell Scripting. UPDATE 2012-11-30 18:56 EDTI changed my mind. I wrote the code using MySQL and Shell Scripting
FURTHER AGNEDA
|
||||
|
|
|
This may not be a suitable answer, but would achieve your goal... What about, for the time you want it offline, renaming the database? This way, whatever application you have accessing the data would fail to connect to the database. |
|||
|
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.