I am using MySQL database and using an Ubuntu Linux machine.
My database named
db_test , I notice that under path
/var/lib/mysql/db_test ,there are files suffix with
.MYI like following:
/var/lib/mysql/db_test# ls cars.frm cars.MYD cars.MYI customers.frm customers.MYD customers.MYI departments.frm departments.MYD departments.MYI ...
.MYI files group mapped with one table in the database.
I have following two questions to ask:
What are the three files doing exactly?
If I create a new directory under path
db_test_2, and copy every file from
db_test_2, will it also create a new database
db_test_2which has exactly the same contents(tables) as
Does this physically database files moving action create the same result as following command-line actions:
dump the database
create a new database
then dump the
db_test_1database back into the new database
If so, it seems moving files are much faster then using
mysqldump to copy databases(or to importing data from one DB to another DB in MySQL). Any opinions on this?