Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Command not Found [MAMP]

Tags:

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

like image 676
IdeoREX Avatar asked Jul 15 '13 21:07

IdeoREX


People also ask

Why MySQL server is not starting in MAMP?

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.

Why is MySQL command not found Mac?

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.

Does MAMP install MySQL?

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!


Video Answer


1 Answers

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!

like image 94
Vincent Orback Avatar answered Sep 22 '22 13:09

Vincent Orback