Database gone, tables empty | alter ignore add unique | truncate


i accidentaly “emptied” a table with approx 360 entries.

After adding “chatname varchar(30)”, i executed “alter ignore add unique(chatname)” on the “users” table, resulting only 1 row left.

After this i got a bit angry, and truncated all tables in the database :S

Is there any way this database can be recovered? This database is innodb. What tool should i use?

Also i am having some difficulties compiling the percona tools. I use “./configure” inside mysql-source/, then i do a “make” 1 directory below, and get the error “/usr/bin/ld: cannot find -lrt”

Above problem is solved, -lrt on centos is provided by “yum install glibc-static”

The 1 percone tool i did manage to use gave me an error like “does not support point”

Regards Webbie

There is no way to recover data once deleted from database and hence from disk, backup is best strategy before doing any alter or major schema change.


If your server is still started and data is being written to the database then it might be happen that the deleted records are overwritten. But still you can try with this tool.

that is great tool indeed and i need to test it how it can help in production environment. i think it works in same manner as disk recovery tool where data should not be overwritten or disk inodes should not be updated.