Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does MySQL store database files?

I have uninstall wamp server and now I need my database to restore. How can I do this process?

like image 200
Ihsanullah khan Avatar asked Jan 19 '10 05:01

Ihsanullah khan


People also ask

Where are DB files stored?

db file might be located at either of these locations: C:\Users\[username]\AppData\Local\Packages\Microsoft.

Where does MySQL store database files on Linux?

By default, the datadir is set to /var/lib/mysql in the /etc/mysql/mysql.


2 Answers

In any case you can know it:

mysql> select @@datadir; +----------------------------------------------------------------+ | @@datadir                                                      | +----------------------------------------------------------------+ | D:\Documents and Settings\b394382\My Documents\MySQL_5_1\data\ | +----------------------------------------------------------------+ 1 row in set (0.00 sec) 

Thanks Barry Galbraith from the MySql Forum http://forums.mysql.com/read.php?10,379153,379167#msg-379167

like image 75
Jorge Nunez Newton Avatar answered Sep 18 '22 17:09

Jorge Nunez Newton


WAMP stores the db data under WAMP\bin\mysql\mysql(version)\data. Where the WAMP folder itself is depends on where you installed it to (on xp, I believe it is directly in the main drive, for example c:\WAMP\...

If you deleted that folder, or if the uninstall deleted that folder, if you did not do a DB backup before the uninstall, you may be out of luck.

If you did do a backup though phpmyadmin, then login, and click the import tab, and browse to the backup file.

like image 34
Cryophallion Avatar answered Sep 18 '22 17:09

Cryophallion