Craft 3: Can't backup database ("mysqldump: command not found") I just tried to export the DB on the Database Backup page. Unfortunately, I got an error message saying "There was a problem backing up your database. Please check the Craft logs."

So I checked the logs, and found this...


  Could not create backup: The shell command "mysqldump --defaults-extra-file=/mysite/storage/runtime/temp/my.cnf... failed with exit code 127: sh: mysqldump: command not found...


(There's more to that error message, but I'm hoping that all the relevant parts are included here.)

What am I missing? It seems like I still need to install something else, is that correct?
Craft 3 did away with the PHP-based database backup solution that Craft 2 utilized (for many reasons).

Now it requires that the mysqldump executable (if you're using MySQL) or pg_dump executable (if you're using PostgreSQL) is available to PHP in order to do backups.  This is usually just a matter of including the path to that executing in your PATH environment variable.

There is also the backupCommand config setting that you can use to override Craft's default backup implementation if you have some other backup solution you'd like to use.

Same for restoreCommand.

Related issue here: https://github.com/craftcms/cms/issues/1369