# Spatie Laravel Backup - sh: mysqldump: command not found

- Author: Kyle Murphy
- Posted: 17 Sept 2024 (updated on 7 Oct 2026)

![A green terminal icon above the error message mysqldump command not found, with the Custom Code IT logo at the top.](https://www.customcodeit.com.au/_astro/spatie-backup-not-found.DqaTR0GK_Z1tTcdJ.webp)

## The problem

One of the software projects I'm working on uses the fantastic [Laravel-Backup packages from Spatie](https://spatie.be/docs/laravel-backup/v8/introduction).

The application needs to run on-demand backups from the web interface. When I called Laravel's `Artisan::call()` method, I ran into this error:

```bash
sh: mysqldump: command not found
```

## The solution

If you've confirmed that MySQL or MariaDB is installed and running, find the binary with:

```bash
which mysqldump
```

Then add the path to the binary with the following config change in your `config/database.php` file:

```php
'mariadb' => [
  ...
  'dump' => [
    'dump_binary_path' => env("DUMP_BINARY_PATH"),
  ]
]
```

The `DUMP_BINARY_PATH` environment variable points to your mysqldump path. In my case, it was:

```bash
/opt/homebrew/opt/mariadb@10.11/bin
```

Just include the path to the binary, not the binary itself.

Success! You should now be able to run the command from your web interface.

## Need a hand with this?

- [Website Maintenance for Existing Sites](https://www.customcodeit.com.au/services/maintain-existing-websites)

    Have a website that needs tuning up, or someone to take over its day-to-day running? We can help, without selling you things you don't need.

## More from the blog

Kyle Murphy

15 Sept 2024

### [Password Managers: Securing Your Digital Life (Part 1)](https://www.customcodeit.com.au/blog/securing-your-digital-life-tips-best-practices-part-1-password-managers)

What a password manager is, why you need one, how to choose a master password and what a business gains from using one. Part 1 of 3.

- password managers
- tutorial
- information

Kyle Murphy

31 May 2022

### [Linux Backups with Restic and S3](https://www.customcodeit.com.au/blog/linux-backups-with-restic-and-s3)

A walkthrough of fast, encrypted Linux backups to S3-compatible storage with Restic, using Linode Object Storage as the example.

- linux
- backups
- restic
- s3
- tutorial

Kyle Murphy

3 Mar 2025

### [Static vs Dynamic Websites: Choosing the Right Tool for the Job](https://www.customcodeit.com.au/blog/static-vs-dynamic-websites-choosing-the-right-tool-for-the-job)

Static or dynamic website? A plain-English look at the pros and cons of each, from hosting cost and security to editing, plugins and maintenance.

- websites
- hosting

## You made it this far, you should probably contact us.

Take a moment to celebrate, give that scrolling finger a break, then contact us because we'd love to hear from you.

[Shop 07 4646 2400](tel:0746462400) [Mobile 0466 624 345](tel:0466624345)

---

Page: https://www.customcodeit.com.au/blog/spatie-laravel-backup-command-not-found-mysql
About this site, for agents: https://www.customcodeit.com.au/llms.txt
