title: How to find the mysql data directory from command line in windows
body: <p>In linux I could find the mysql installation directory with the command <code>which mysql</code>. But I could not find any in windows. I tried <code>echo %path%</code> and it resulted many paths along with path to mysql bin. </p>
  
  <p>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?</p>
  
  <p>In my case, the mysql data directory is on the installation folder i.e. <code>..MYSQL\mysql server 5\data</code> It might be installed on any drive however. I want to get it returned from the command line.</p>