Reputation: 5087
Im going to move database files location (including changing datadir
in my.cnf
).
but I still not clear about FLUSH TABLES;
mysql website says: "clears or reloads various internal caches used by MySQL"
some people says: "forcing all open tables (those in the table cache) to be closed"
what is open and close tables? do I need to flush table when move database files location ?
Upvotes: 0
Views: 187
Reputation: 53607
The safest is to simply shut down the server, move the files, turn it on.
Tables can have locks on them (read and/or write), a query can be touching some of the tables in the DB, The tables caches it's cardinality (how unique is the field value) and the number of records in it for example...
Upvotes: 1
Reputation: 60528
Any data that needs to be flushed should be flushed when the server shuts down, and you'll need to shut down the server anyways for the config changes to work, so here's what I would do:
Upvotes: 3