where does MySQL store database files?
Asked Answered
S

5

54

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

Surbeck answered 19/1, 2010 at 5:38 Comment(2)
phpmyadmin is just a program for accessing databases, I think your question is "Where are MySQL databases stored?"Quass
@BrendanLong I understand the question was originally about phpmyadmin. So, where does phpmyadmin read the database from? Is this directory setupable? I want mysql to be on separate container, is it possible? (Please let me know if this would be subject to another SO question; I can not find right answers.)Elwoodelwyn
S
105

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

Shun answered 20/6, 2012 at 17:23 Comment(3)
much more useful answer for any mysql installation, thanks bud.Magnetohydrodynamics
@Magnetohydrodynamics agreed, this helped me as well since it was much more general.Casein
Being on a shared host with no visibility into the file system, this is what I needed.Hermosillo
C
27

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.

Corymb answered 19/1, 2010 at 13:35 Comment(2)
Thanks! I found this answer while running a search on my hard drive looking for the same thing. I have a xampp installation with MySQL Server 5.5 on Windows 7. For others with a similar setup: I found my data file at C:\ProgramData\MySQL\MySQL Server 5.5\data. On my system I had to manually type in "C:\ProgramData".Ingroup
@Corymb hey this is is of no use I think. Since, when I copied the database from the location which you have intimidated and pasted it on another computer which has same mysql location. The positive side is that it shows the database and the tables in query browser but when I open the table it shows “got error 1 from storage engine error no 1030″Scheer
B
18

Check your my.cnf file in your MySQL program directory, look for

[mysqld]
datadir=

The datadir is the location where your MySQL database is stored.

Barbaresi answered 19/1, 2010 at 5:42 Comment(1)
on linux, this file is usually at: /etc/mysql/my.cnf and the database files are at /var/lib/mysqlChambermaid
C
4

another way from MySQL Workbench:

enter image description here

Contend answered 19/8, 2015 at 7:41 Comment(0)
S
0

For WampServer, click on its tray icon and then in the popup cascading menu select

MySQL | MySQL settings | datadir

MySQL Data Directory

Shiller answered 17/1, 2018 at 14:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.