I wanted to know if there is a way to recover the data of a de-installed mysql server.

link|improve this question
What exactly do you mean by uninstalled/deinstalled?? – Chris S May 18 '11 at 12:25
I mean removing mysql from windows add/remove – Navid May 18 '11 at 12:36
feedback

3 Answers

up vote 2 down vote accepted

The mysql databases are usually stored as files in the filesystem in some location different from the mysqld binaries (e.g. /var/lib/mysql) and not deleted during package removal. You can access the data just by configuring a mysql instance's "datadir" to look there and launching it.

/etc/my.cnf:

[...]
[mysqld]
datadir         = /var/lib/mysql
[...]

Just search your filesystem for files named "ibdata1", "*.MYD" (myISAM table data) or "*.MYI" (myISAM table indexes) to get a clue where your files might be if your old my.cnf is not accessible for a reference anymore.

link|improve this answer
Not a *nix system... – Chris S May 18 '11 at 12:42
I've just seen you are using Windows. In this case the datadir is per default in %programfiles%\MySQL\MySQL Server <version>\Data. Is this directory still present on your system? – syneticon-dj May 18 '11 at 12:44
the problem is I cannot find this directory, can't it be somewhere else? – Navid May 18 '11 at 12:47
@Navid, it can be just about anywhere (on the computer, network, SAN, remote sites connected via VPN... heck, you might be using cloud storage for all we know); if it isn't in that folder. – Chris S May 18 '11 at 12:51
Just run a search for *.MYD across your disks. If you don't find anything, the data is probably gone. You might want to check out some data recovery / undelete tools if you don't have a backup and really really need that data and a partial recovery would do for you - the chances of getting it back in one piece and complete are usually rather bad. – syneticon-dj May 18 '11 at 13:10
show 1 more comment
feedback

It should still be in the installation location, under the data folder (ex, C:\Program Files\MySQL\MySQL Server 4.0\Data)

link|improve this answer
feedback

When MYSQL is uninstalled all the folders are removed except data folder present at.

C:\Program Files\MySQL\MySQL Server 5.0\data

At this location a folder having name same as the schema/database on which you were working earlier will be present.Copy this folder and ibdata1 file at a separate location.

Now reinstall MYSQL again and copy the earlier saved contents(*folder* and ibdata1) at this location

i.e C:\Program Files\MySQL\MySQL Server 5.0\data

Open Mysql Administrator and perform the backup of database.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.