I have many schemas on mysql instance running on my development pc. I've noticed that mysql is taking a large amount of ram and cpu time.
Is there a way to "disable" schemas of project I'm not working for?
I like to avoid to drop schema and then re-import when I need it. I'm searching to a way for just disable them or something similar!
Thanks
Marco
Best Answer
Every subfolder under
datadir
is considered fair game to be registered as a database. You could just mysqldump that entire database and then drop the database.SUGGESTION
If you have to leave the database present but inaccessible, here is something radical you can try:
EXAMPLE
Suppose you have a database called
mydb
and you want to disable access to it. Go into the Linux OS and do the following:That's it. Since
/var/lib/mysql/mydb
would be no longer owned by the Linuxmysql
user, mysqld cannot access anything in that folder.If you want the database accessible again, just do the reverse:
Now, if you are dealing with Windows, try shutting down mysql with
You could then
mydb
to#mydb
something mysqld would not likeattrib
+a against that folderFinally, start mysql back up
Give it a Try !!!