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.
Check if the
Data
directory is in"C:\ProgramData\MySQL\MySQL Server 5.7\Data"
. This is where it is on my computer. Someone might find this helpful.You can try this-
PS- It works on every platform.