Abhishek
Abhishek

Reputation: 1466

Where do the MySQL database files reside for WAMP?

I'm just curious as I am beginning to learn PHP and MySQL, as to where the database and other files of MySQL reside on the hard drive. I have installed WAMP on a Windows XP SP2 platform.

Upvotes: 21

Views: 44966

Answers (7)

Sudeep
Sudeep

Reputation: 129

Use the following to find the data directory using SQL console:

show variables like 'datadir'

Upvotes: 2

Kyle Coots
Kyle Coots

Reputation: 2131

If your on linux you can use:

sudo find / mysql | grep mysql

On Ubuntu it stores its database files in /var/lib/mysql

Upvotes: 1

kv.
kv.

Reputation: 151

Explore variables from the output of following command:

mysql> show variables like '%dir%';

Upvotes: 14

Caremy
Caremy

Reputation: 33

wamp/bin/mysql/mysqlx.x.x/data

Upvotes: 0

Yugal Jindle
Yugal Jindle

Reputation: 45726

Data directories for mysql database :

Generally,

Windows wamp setup : mysql/data Linux (Ubuntu) : /var/lib/mysql

Configured Location: [ my.cnf configures it as datadir ]

Linux :

$ cat /etc/mysql/my.cnf | grep 'datadir'

Windows :

  Open mysql/my.cnf (search for `datadir` )

From mysql prompt : ( mysql> ) [ PREFERRED WAY ]

  mysql> show variable like 'datadir';

I suppose that covers pretty much all cases.

Upvotes: 13

Alex Cheng
Alex Cheng

Reputation: 711

I am not sure about WAMP, but if you install MySQL manually it should reside somewhere along the lines of this path:

C:\Program Files\MySQL\MySQL Server 5.1

Upvotes: 2

Pekka
Pekka

Reputation: 449803

Usually in the /mysql/data directory of your WAMP installation. You'll recognize the location because every database has a folder with the same name there.

You can change the location of the data directory using the datadir setting in my.cnf. It is often moved elsewhere to ensure the data there gets backed up regularly.

Upvotes: 9

Related Questions