How do I make MySQL run in memory rather than store all the data in files? I realize this can be a risk (if the server crashes I loose all data) but I understand it is much faster. Does anyone have any experience with this and how this is done? Does it really run faster?
You could create a virtual drive in RAM. I would never recommend doing this, however.
Because you will loose all of your data/information if the computer is shut-down?
Exactly. Power outages won't give you a chance to let you save the file.
You can create a table in memory:
This will cause all data in that table to be in memory. Take heed to WPs warning though.Code:CREATE TABLE t (i INT) ENGINE = MEMORY;
More info: MySQL :: MySQL 5.0 Reference Manual :: 13.4 The MEMORY (HEAP) Storage Engine
cool, can be useful when dealing with temporary tables
So servers use this? Because when it crashes usually the data is lost and they just restore a backup.. while if it was stored on the HDD the data would be recovered...
Probably for temporary tables only. I can't think of reason you would store permanent data in memory.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks