If you only see the .frm files, then there is a strong likelihood that the storage engine in use was InnoDB and innodb_file_per_table must have been off by default.
If you transferred everything from datadir on the crashed server onto another disk on another machine, you may be able to startup mysql with that folder as is.
For example, suppose ServerA is your crashed server and ServerB is where you want it placed.
- Install MySQL 5.5.8 on ServerB
net stop mysql
on ServerB to make sure mysql is down on ServerB
md C:\MySQLData
on ServerB
- Drop everything from the data folder on ServerA into C:\MySQLData on ServerB
- Make C:\MySQLData the new datadir
Add this to my.ini on ServerB
[mysql]
datadir=C:/MySQLData
C:\> del C:\MySQLData\ib_logfile*
on ServerB
net start mysql
on ServerB
Please try this and tell us what happened
UPDATE 2012-02-03 17:06 EDT
Since you were able to recover everything NOW DO THIS:
mysqldump -u... -p... -A -d --routines --triggers > C:\MySQLSchema.sql
This will give all table structures in the MySQL Instance.
In order to restore the MyISAM called table_name
into database_name
you must do the following
STEP 01) Run this query : show variables like 'datadir';
This will tell you what the base directory is for data. For this example, let's use the default (/var/lib/mysql)
STEP 02) Copy table_name.frm to /var/lib/mysql/database
STEP 03) Copy table_name.MYD to /var/lib/mysql/database
STEP 04) Copy table_name.MYI to /var/lib/mysql/database
STEP 05) chown mysql:mysql /var/lib/mysql/database/table_name.*
That's it. A mysql restart is not needed because the information_schema database is very sensitive and detects folder changes very quickly.
To make sure the restored table is known to mysql, do the following:
STEP 06) Run this query
SELECT * FROM information_schema.tables
WHERE table_schema = 'database_name'
AND table_name = 'table_name'\G
You should see information about the table size and change dates
STEP 07) Run these commands
use database_name
show tables;
You should see the restored table in the listing
Best Answer
Open the .frm file with a hex editor. Go to offset 0x33 and read four bytes. Convert to decimal, keeping your endianness in mind.
Examples:
c0c30000
-->c3c0
-->50112
--> version5.1.12
64c50000
-->c564
-->50532
--> version5.5.32
b2860100
-->186b2
-->100018
--> version10.0.18
(MariaDB)19870100
-->18719
-->100121
--> version10.1.21
(MariaDB)Sources: