I'm working to set up my MySQL server using MAMP.
Current Status: Downloaded MySQL, MAMP Running MAMP: MySQL Server is green, plus it appears as a process in activity monitor
I tried:
$ mysql -bash: mysql: command not found
I saw some tutorials that recommended adding a path to my .profile file. So I created a .profile file and added
PATH=$PATH:/Applications/MAMP/Library/bin export PATH
I then saved it as .profile in the home directory.
Again I tried
$ mysql -bash mysql: command not found
Does anyone have any idea what's wrong?
Thanks
OS: Mountain Lion
The issue is usually due to another MySQL service running on the same port. The easiest solution is to kill all MySQL processes and restart MAMP. On macOS, you can do this using the Activity Monitor, which you'll find in the Utilities folder on your computer.
On macOS, you should be able to use mysql command once you installed MySQL using the official macOS installer or Homebrew. If you find the command not found error, then you need to manually add the bin/ folder to your . bashrc or . zshrc file if you use ZSH command line client.
MAMP comes free of charge, and is easily installed. MAMP will not compromise any existing Apache installation already running on your system. You can install Apache, Nginx, PHP and MySQL without starting a script or having to change any configuration files!
A simple way is to just run
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql
What this does is add a symbolic link for the mysql binary from MAMP into your executable path – in this case, within /usr/local/bin/
Warning: If you’ve installed MySQL manually as well, this may interfere with that installation, so don’t do this if you have!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With