Portal Home > Knowledgebase > Articles Database > Mysql recover in a vps
Mysql recover in a vps
Posted by kselva, 03-01-2010, 11:41 PM |
we have deleted some data stored in mysql in a vps (openvz),now we want recover it . The file size of .MYD still remains unchanged so can we recover the data ?
|
Posted by JohnCS, 03-02-2010, 04:50 AM |
I think you can't recover data if you don't have backup.
|
Posted by david510, 03-02-2010, 05:06 AM |
How have you deleted the data? Removed the db files or used "mysqladmin drop dbname" ?
|
Posted by kselva, 03-02-2010, 05:15 AM |
I have used Delete query to delete the records...
|
Posted by david510, 03-02-2010, 05:36 AM |
You have any dump file for the db? We can restore the table data only. Meanwhile you have option "logbin" enabled in my.cnf?
|
Posted by kselva, 03-02-2010, 05:59 AM |
I don't have any dump file and also not enabled logbin . But after deletion i can seen the size of .MYD file remains unchanged . Can retrive data from MYD ? or any other way ?
|
Posted by madaboutlinux, 03-02-2010, 06:29 AM |
MYD file contains the data but you need the other 2 files i.e. .frm and .MYI to retain the data.
If the other 2 files are missing, try a workaround.
Copy the MYD file safely somewhere else. Create the same table again with the exact same structure using any easy method you wish (mysql prompt OR phpMyAdmin).
Once the table is created, it will create the 3 files again. Replace the new .MYD file with the old one and repair the table from the mysql prompt
See if it helps.
|
Posted by V(o)ViK, 03-02-2010, 06:41 AM |
You can try to create new database with the same structure and override .MYD file.
|
Posted by kselva, 03-03-2010, 05:37 AM |
madaboutlinux
I have tried as per your suggestion but not worked . When i give 'repair table' the deleted records are not recovered .
|
Add to Favourites Print this Article
Also Read