How to find the mysql data directory from command line in windows

In linux I could find the mysql installation directory with the command which mysql. But I could not find any in windows. I tried echo %path% and it resulted many paths along with path to mysql bin.

I wanted to find the mysql data directory from command line in windows for use in batch program. I would also like to find mysql data directory from linux command line. Is it possible? or how can we do that?

In my case, the mysql data directory is on the installation folder i.e. ..MYSQL\mysql server 5\data It might be installed on any drive however. I want to get it returned from the command line.

8 Answers
8

Leave a Comment