Importing frm, myi, myd database files

I feel like I should have known this but I didn't.

I co-worker gave me the files for a cms to install on my local server recently. I opened the directory with the database files expecting to find a nice fat .sql file but instead found an array or .frm, .MYI and .MYD files.

I recall seeing these before but I had alternatives and never dealt with it. This time I just asked.

These are the data files from the MySQL server. They are pulled directly from the MySQL server directory and can be used to import, transfer, install or back up databases if you have access to that directory or not.

Looking into the directory where MySQL is installed there is usually a "data" directory. In here are all of the various databases in separate directories. Dropping this directory in there will make the files available to the MySQL server.

There are some notes to keep in mind.
The directory made need to be modified to permit read/write/etc access.
The MySQL server may need a restart in order to recognize the files.
If you don't have access to the MySQL data directory you can install the files on a local installation of MySQL and use MySQL Administrator to back them up as a .sql file.
About author

Reli4nt is a business manager and web developer and the JP behind The JPProject. He is a proverbial jack-of-all-trades-master-of-none, and an all around simple and down to earth kind of guy.