0

I'm trying to use wp-cli on Ubuntu and I'm using Xampp to run WordPress, but every time I try run this command:

wp core config --dbname=demo-1 --dbuser=root --dbpass=hola --dbhost=localhost --dbprefix=wp_ --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP

I get this error:

/usr/bin/env: «mysql»: No existe el archivo o el directorio

command line screenshot

I just added: "export PATH=$PATH:/usr/bin/env/mysql" but it doesn't work.

Does anybody know how I can fix this?

cabrerahector
  • 3,653
  • 4
  • 16
  • 27
EdT
  • 1
  • 1
    Please post code, errors, sample data or textual output here as plain-text, not as images that can be hard to read, can’t be copy-pasted to help test code or use in answers, and are barrier to those who depend on screen readers or translation tools. You can edit your question to add the code in the body of your question. For easy formatting use the `{}` button to mark blocks of code, or indent with four spaces for the same effect. The contents of a **screenshot can’t be searched, run as code, or copied and edited to create a solution.** – tadman May 30 '21 at 15:26
  • 1
    That's not the right path. `/usr/bin/env` is a way of running the `mysql` bin, which itself needs to be in your path. `/usr/bin/env` likely already is. I'm going to suppose you don't have MySQL installed, as that binary is usually available if it is. – tadman May 30 '21 at 15:26
  • Indeed as @tadman says, you don't have the mysql client. To be 100% sure try `which mysql`. It will say `not found` so check the instructions for your server OS to install mysql. – Andrea Olivato May 30 '21 at 15:58
  • $which mysql return empty, but! I can access in mysql after start xampp then go to ` $ /opt/lampp/bin$ ./mysql -u root -p ` – EdT May 30 '21 at 17:41
  • Hey, I solved! with `"$ sudo ln -s /opt/lampp/bin/mysql /usr/bin/"` ! – EdT May 30 '21 at 18:25

0 Answers0