How to find the MariaDB data directory

29 June,2022 by Rambler

I received a question from a XAMPP developer about how to find the data directory in MariaDB. They were receiving the error : ERROR 1010 (HY000): Error dropping database (can't rmdir './mydatabase', errno: 39 "Directory not empty")   and needed to establish the data directory location    . 

 

The purpose was to delete some non-table files - read here for an Easy fix for ERROR 1010 (HY000): Error dropping database

To find the MariaDB data directory use the following statement: 

select @@datadir;

This command will return the directory e.g   /mydatapath/myfolder 

@@datadir  returns the directory where your database files are stored.

 

For more MariaDB commands - Quick access to MariaDB Cheatsheet

 


Author: Rambler (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to find the MariaDB data directory


dba-ninja.com