mysqldatadirectory

What is DataDir in MySQL?


I know the usage of @@datadir in MySQL queries such as;

Select @@datadir;

It outputs something like that:

C:\xampp\mysql\data\

But what the heck is it? What does it do? Is there any special meaning about directory data of MySQL? Why is there a specific command in MySQL like @@datadir?


Solution

  • It is the directory where your database files are stored.

    It can be changed when installing the server or before running it and is of special meaning for larger servers, e.g. clustered MySQL servers running on multiple servers.