Not the answer you need?
Register and ask your own question!

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

webbiewebbie EntrantInactive User Role Beginner
Hello,

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

Comments

  • yogesh777yogesh777 Contributor Current User Role Beginner
    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.
  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner
    Hi,

    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. http://www.percona.com/software/mysql-innodb-data-recovery-tools
  • yogesh777yogesh777 Contributor Current User Role Beginner
    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.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.