Find out where MySQL is installed on Mac OS X
Sebastian Wright
How do I find out where MySQL is installed on Mac OS X 10.7.9? I have MAMP installed so I presume that it is bundled with this install?
8 Answers
To check MySQL version of MAMP , use the following command in Terminal:
/Applications/MAMP/Library/bin/mysql --versionAssume you have started MAMP .
Example output:
./mysql Ver 14.14 Distrib 5.1.44, for apple-darwin8.11.1 (i386) using EditLine wrapperUPDATE: Moreover, if you want to find where does mysql installed in system, use the following command:
type -a mysqltype -a is an equivalent of tclsh built-in command where in OS X bash shell. If MySQL is found, it will show :
mysql is /usr/bin/mysqlIf not found, it will show:
-bash: type: mysql: not foundBy default , MySQL is not installed in Mac OS X.
Sidenote: For XAMPP, the command should be:
/Applications/XAMPP/xamppfiles/bin/mysql --version 5 It will be found in /usr/local/mysql if you use the mysql binaries or dmg to install it on your system instead of using MAMP
If you run SHOW VARIABLES from a mysql console you can look for basedir.
When I run the following:
mysql> SHOW VARIABLES WHERE `Variable_name` = 'basedir';on my system I get /usr/local/mysql as the Value returned.
(I am not using MAMP - I installed MySQL with homebrew.
mysqldon my machine is in /usr/local/mysql/bin so the basedir is where most everything will be installed to.
Also util:
mysql> SHOW VARIABLES WHERE `Variable_name` = 'datadir'; To find where the DBs are stored.
For more:
and
3If you downloaded mySQL using a DMG (easiest way to download found here ) in Terminal try: cd /usr/local/
When you type ls you should see mysql-YOUR-VERSION. You will also see mysql which is the installation directory.
Source:
If you've installed with the dmg, you can also go to the Mac "System Preferences" menu, click on "MySql" and then on the configuration tab to see the location of all MySql directories.
Reference:
for me it was installed in /usr/local/opt
The command I used for installation is brew install [email protected]
Or use good old "find". For example in order to look for old mysql v5.7:
cd /
find . type -d -name "[email protected]" 1 For me I was able to get the location at the path "/opt/homebrew/etc"
I have installed mysql using homebrew.
If you are not able to get the exact path start the mysql server -> mysql.server start
then run mysql -v to check the version, it will bring you in to the mysql.
run SHOW VARIABLES WHERE Variable_name = 'basedir'.
Navigate to path "/opt/homebrew/etc"