I just installed wp-cli using homebrew and changed the PHP path in .bash_profile to below.

export WP_CLI_PHP=/Applications/MAMP/bin/php/php5.6.10/bin/php
export PATH=$PATH:/Applications/MAMP/Library/bin

When I run this command,

wp core config --dbname="testwp" --dbuser="root" --dbpass="root"

I get this error:

sh: mysql: command not found

Also the output of running wp –info is:

PHP version:    5.6.10
php.ini used:   /Applications/MAMP/bin/php/php5.6.10/conf/php.ini
WP-CLI root dir:    /usr/local/Cellar/wp-cli/0.21.1
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.21.1

I’m not sure if I have framed my question well, so would appreciate all the help.

1 Answer
1

It looks like you probably don’t have mysql in your path.
From the command prompt, you should be able to run ‘mysql’ and enter the mysql interactive environment. If you see something like ‘command not found.’ then keep working on that path.

There are few different ways to set up your path, I prefer to update the system PATH environment variable so that it become a one-time-thing. (google it – it is a pain on both Windows or Mac).

This post (https://stackoverflow.com/questions/17664021/mysql-command-not-found-mamp) suggests your proper path is something like this.. PATH=$PATH:/Applications/MAMP/Library/bin

Good luck

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *