Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (6.1k points)

I can't get my MySQL to start on os x 10.7. It is located in /usr/local/mysql/bin/mysql.

I'm getting the command as not found when I execute mysql --version in the terminal.

I have also tried installing MySQL with the dmg and I have tried to install it through homebrew and I can't get it to work. When I tried to start mysql with homebrew, I'm just getting it as MySQL won't start.

To check, this is my $PATH:


1 Answer

0 votes
by (12.7k points)
edited by

I can check that there is a problem with your $PATH :


$PATH is where the shell searches for command files. Folders to look in got to be separated with a colon. And so you want /usr/local/mysql/bin/ in your path but instead it searches in /usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin  , which probably doesn't exist.

Instead you want ${PATH}:/usr/local/mysql/bin .

 So do export PATH=${PATH}:/usr/local/mysql/bin. 

If you want this to be run every time you open terminal put it in the file .bash_profile , which is run when Terminal opens.

If you would like this to be run whenever you open terminal, put it within the file .bash_profile , which is run when Terminal opens.

I hope this helps !

Want to know more about SQL ? Join SQL Certification now !

Related questions

0 votes
1 answer
asked Dec 20, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
2 answers
asked Oct 16, 2019 in Web Technology by Sammy (47.6k points)
0 votes
1 answer

Browse Categories