sh: mysql: command not found on wp core config #1223

Closed
alessandrotesoro opened this Issue May 25, 2014 · 7 comments

Comments

7 participants
@alessandrotesoro

I've installed wp cli following the guidelines here http://wp-cli.org/ since i'm running MAMP on my mac, i've created a .bash_profile file into my user directory like explained here http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443

My .bash_profile file looks like this

export MAMP_PHP=/Applications/MAMP/bin/php/php5.5.10/bin
export PATH="$MAMP_PHP:$PATH"

If i run wp --info

i get this

PHP binary: /Applications/MAMP/bin/php/php5.5.10/bin/php
PHP version:    5.5.10
php.ini used:   /Applications/MAMP/bin/php/php5.5.10/conf/php.ini
WP-CLI root dir:    phar://wp-cli.phar
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 0.15.1

I have then ran the following into the folder i created for my wp installation

wp core download

I have then ran the following to setup the wp-config file

wp core config --dbname=db --dbuser=root

And there's the error

sh: mysql: command not found

What am i doing wrong? I've checked existing topics here on github but i can't find a proper solution to my situation.

@alessandrotesoro

This comment has been minimized.

Show comment
Hide comment
@alessandrotesoro

alessandrotesoro May 26, 2014

Fixed by adding to the bash profile

export PATH=$PATH:/Applications/MAMP/Library/bin/

Fixed by adding to the bash profile

export PATH=$PATH:/Applications/MAMP/Library/bin/
@jmslbam

This comment has been minimized.

Show comment
Hide comment
@jmslbam

jmslbam May 26, 2014

Contributor

Glad you found the fix!

Contributor

jmslbam commented May 26, 2014

Glad you found the fix!

@jackmcconnell

This comment has been minimized.

Show comment
Hide comment
@jackmcconnell

jackmcconnell Oct 5, 2015

This also worked for me after I updated to Max OS X El Capitan.

This also worked for me after I updated to Max OS X El Capitan.

@dendeffe

This comment has been minimized.

Show comment
Hide comment
@dendeffe

dendeffe Oct 6, 2015

Thanks for posting the solution. Worked for me.

dendeffe commented Oct 6, 2015

Thanks for posting the solution. Worked for me.

@jepser

This comment has been minimized.

Show comment
Hide comment
@jepser

jepser Nov 19, 2015

So much thanks man! Worked for MAMP PRO in El Capitan.

jepser commented Nov 19, 2015

So much thanks man! Worked for MAMP PRO in El Capitan.

@krajinovicm

This comment has been minimized.

Show comment
Hide comment

Thank you!

@rob-gordon

This comment has been minimized.

Show comment
Hide comment
@rob-gordon

rob-gordon May 25, 2017

For anyone else having trouble here - it has to be ~/.bash_profile – even if you running the command from zsh or some other shell. That threw me off for a minute. Thanks @alessandrotesoro!

For anyone else having trouble here - it has to be ~/.bash_profile – even if you running the command from zsh or some other shell. That threw me off for a minute. Thanks @alessandrotesoro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment