1
zsh: command not found: mysql

I have exhausted the forums that provide suggestions and nothing is working and most talk about bash_profile, but this is an issue in my zsh environment.

It seems like it is definitely a path problem, this is what mines looks like:

ldco2016@DCortes-MacBook-Pro-3 ~/Projects/photogallery $ echo $PATH                                                                                                                                   [ruby-2.2.1]
/usr/local/share/npm/bin:/Users/ldco2016/.nvm/versions/node/v6.9.1/bin:/Users/ldco2016/.rvm/gems/ruby-2.2.1/bin:/Users/ldco2016/.rvm/gems/ruby-2.2.1@global/bin:/Users/ldco2016/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/mysql/bin:/Users/ldco2016/.rvm/bin:/Users/ldco2016/.rvm/bin:/usr/local/share/npm/bin:/Users/ldco2016/.composer/vendor/bin:/usr/local/mysql/bin:/usr/local/:/usr/local/mysql/bin

Also, when I go to /usr/local, there is no mysql folder in that directory:

ldco2016@DCortes-MacBook-Pro-3 /usr/local $ ll                                                                                                                                                        [ruby-2.2.1]
total 0
drwxr-xr-x    4 ldco2016  admin   136B Oct 13 14:01 Caskroom
drwxr-xr-x   96 ldco2016  admin   3.2K Nov 25 18:13 Cellar
drwxr-xr-x    3 ldco2016  admin   102B Aug  6 17:06 Frameworks
drwxr-xr-x   16 ldco2016  admin   544B Nov 25 18:12 Homebrew
drwxr-xr-x    6 root      wheel   204B Jun 28 08:18 MacGPG2
drwxr-xr-x@  11 ldco2016  staff   374B Aug  2 18:26 apache-maven
drwxrwxr-x  432 ldco2016  admin    14K Nov 25 18:13 bin
drwxr-xr-x   16 ldco2016  admin   544B Nov 25 18:13 etc
drwxr-xr-x   20 root      wheel   680B Oct 19 13:12 go
drwxr-xr-x  122 ldco2016  admin   4.1K Oct 26 20:11 include
drwxr-xr-x  282 ldco2016  admin   9.4K Oct 23 04:36 lib
drwxr-xr-x   96 ldco2016  admin   3.2K Nov 25 18:13 opt
drwxr-xr-x    4 ldco2016  admin   136B Oct  3 14:15 sbin
drwxr-xr-x   55 ldco2016  admin   1.8K Oct 26 20:11 share
drwx------@  46 ldco2016  staff   1.5K Aug  1 17:48 terraform
drwxr-xr-x   10 ldco2016  admin   340B Sep 21 18:01 var

These are the places where I have found mysql:

/Applications/MAMP/db/mysql
/Applications/MAMP/db/mysql/mysql
/Applications/MAMP/Library/bin/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/auto/DBD/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/DBD/mysql
/Applications/MAMP/Library/lib/python2.7/site-packages/mysql
/Applications/MAMP/tmp/mysql
/Applications/Zend Studio.app/Contents/Eclipse/plugins/com.zend.php.datatools.core_13.5.1.v20160705-1334/resources/drivers/mysql
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Application Support/appsolute/MAMP PRO/db/mysql
/Library/Application Support/appsolute/MAMP PRO/db/mysql/mysql
/private/etc/paths.d/mysql
/private/var/mysql
/Users/ldco2016/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0/lib/active_record/connection_adapters/mysql
/Users/ldco2016/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/mysql
/Users/ldco2016/.rvm/gems/[email protected]/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/mysql
/Users/ldco2016/Documents/PycharmProjects/Survey/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/mysql
/Users/ldco2016/Documents/PycharmProjects/Survey/env/lib/python3.5/site-packages/django/db/backends/mysql
/Users/ldco2016/ps-ansible/roles/mysql
/Users/ldco2016/workspace/todo/rails/activerecord/lib/active_record/connection_adapters/mysql
/usr/local/Cellar/ansible/2.1.1.0/libexec/lib/python2.7/site-packages/ansible/modules/core/database/mysql
/usr/local/Cellar/ansible/2.1.1.0/libexec/lib/python2.7/site-packages/ansible/modules/extras/database/mysql
/usr/local/lib/python2.7/site-packages/ansible/modules/core/database/mysql
/usr/local/lib/python2.7/site-packages/ansible/modules/extras/database/mysql
/usr/local/lib/python3.5/site-packages/django/contrib/gis/db/backends/mysql
/usr/local/lib/python3.5/site-packages/django/db/backends/mysql
/usr/local/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/mysql

How can I proceed based on this evidence?

12
  • Windows? Linux? Give us a bit of a clue Commented Dec 20, 2016 at 16:22
  • Sounds like you don't have mysql installed at all. Commented Dec 20, 2016 at 16:25
  • Set your env variable for zsh. I mean set your mySQL path to be recognized by zsh environment. There are lots of tutorial on how to check and add env variables in zsh. Commented Dec 20, 2016 at 16:30
  • @RiggsFolly, I am doing this on a Mac. Commented Dec 20, 2016 at 16:36
  • @aynber, how do I install mysql in the context of working with my Laravel app? I believe I have already added env variables in zsh. Commented Dec 20, 2016 at 16:39

1 Answer 1

0

In order to use mysql, you first need to install the server itself, then add it to the PATH. Once it's installed and running, make sure that the correct credentials are in your .env file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.