What happens if my server loses power and I'm using the MEMORY engine?

268 Views Asked by At

Does the MEMORY storage engine of MySQL ever write to disk the database contents?

Meaning, if I'm using the MEMORY storage engine and my database server loses power - do I lose all of my database content or is it backed up to disk?

1

There are 1 best solutions below

0
On BEST ANSWER

According to the documentation,

As indicated by the name, MEMORY tables are stored in memory. They use hash indexes by default, which makes them very fast, and very useful for creating temporary tables. However, when the server shuts down, all rows stored in MEMORY tables are lost. The tables themselves continue to exist because their definitions are stored in .frm files on disk, but they are empty when the server restarts.