Find the MySQL installation directory location in MAC

Run the following command in terminal

ps aux|grep mysql

The output will come like this:

_mysql            4945   0.0  0.0 408186784    656   ??  S    Wed06PM   0:03.59 /usr/sbin/distnoted agent
_mysql             359   0.0  0.3 36149796  47436   ??  Ss   13Apr22   6:40.99 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 

In the above results get the value of –basedir property. That value represents the base directory of MySQL installation on MAC. In the above example, /usr/local/mysql is the installation directory.