<p>I believe we were conversing via Medium yesterday on this issue.</p>

<p>Regarding your question, I know for a fact your PATH reference is incorrect. The path to mysqldump is never <code>~/.local/bin/mysqldump</code>; mine is located at <code>/usr/local/bin/mysqldump</code> (I'm using MariaDB).</p>

<p><strong><em>BUT</em></strong> since you said on Medium that you're using MySQL (instead of MariaDB or another database option), you should use this instead: <code>export PATH="/usr/local/mysql/bin:$PATH"</code>.</p>

<p>After you add that to your <code>.bash_profile</code> and either <a href="https://stackoverflow.com/a/4608197/4914302">source the file</a> or quit and relaunch terminal, <code>mysqldump</code> should be working.</p>

CC BY-SA 3.0
2018-03-28T13:14:40.550Z
2018-03-28T13:14:40.550Z
Jalen Davenport
<p>I don’t know if the following will help with Valet, but I ran into the same problem today with my local Homebrew dev server. Despite having <code>/usr/local/bin</code> in my PATH and mysqldump working just fine on the command line the backup task would fail.</p>

<p>Checking the PHP info page revealed that Apache was running with a PATH setting of <code>/usr/bin:/bin:/usr/sbin:/sbin</code>. So there’s your problem.</p>

<p>After trying various different approaches for setting envvars and getting nowhere I eventually found that setting the PATH via the Apache launch daemon file did the job, per <a href="https://stackoverflow.com/a/6834024/1777801">this SO thread</a> and <a href="https://gist.github.com/srayhunter/5208619" rel="nofollow noreferrer">this gist</a>.</p>

<p>For my setup this meant editing <code>/usr/local/opt/httpd/homebrew.mxcl.httpd.plist</code> and adding the following within the main <code>&lt;dict&gt;</code> tag:</p>

<pre><code>  &lt;key&gt;EnvironmentVariables&lt;/key&gt;
  &lt;dict&gt;
   &lt;key&gt;PATH&lt;/key&gt;
   &lt;string&gt;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin&lt;/string&gt;
  &lt;/dict&gt;
</code></pre>

<p>After adding that and running <code>brew services restart httpd</code> my PATH finally updated and the export task started working.</p>

CC BY-SA 3.0
2018-03-28T19:05:34.010Z
Just a note, great info for future reference but the OP is not using Apache since he's working with Laravel Valet which is Nginx only.
Jalen Davenport
CC BY-SA 3.0
2018-03-29T09:25:24.037Z
Ah thanks, I should have checked that. I’ll leave the post up in case it helps anyone else looking to fix this error with their Apache setup.
Dom Stubbs
CC BY-SA 3.0
2018-03-28T16:03:59.817Z
2018-03-28T16:03:59.817Z
Dom Stubbs
<p>I'm using Laravel Valet with Craft 3 (Craft 3.0.0-RC13) and Sequel Pro. </p>

<p>I can't seem to get Craft to update. I just get a warning sign and a message saying that it couldn't back up the database.</p>

<p>When I looked at my log file, it contained the following:</p>

<blockquote>
  <p>FROM <code>craft_info</code>
  2018-03-27 09:54:43 [127.0.0.1][1][-][error][craft\controllers\UpdaterController::actionBackup] Error backing up the database: The shell command "mysqldump --defaults-extra-file="/Users/richardclark/Sites/lorindafontainefarris/storage/runtime/temp/my.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --single-transaction --no-data --result-file="/Users/richardclark/Sites/lorindafontainefarris/storage/backups/lorinda-fontaine-farris_180327_135443_jfivi9ibwf_v3.0.0-rc16.1.sql" lorindafontainefarris &amp;&amp; mysqldump --defaults-extra-file="/Users/richardclark/Sites/lorindafontainefarris/storage/runtime/temp/my.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --no-create-info --ignore-table=lorindafontainefarris.craft_assetindexdata --ignore-table=lorindafontainefarris.craft_assettransformindex --ignore-table=lorindafontainefarris.craft_cache --ignore-table=lorindafontainefarris.craft_sessions --ignore-table=lorindafontainefarris.craft_templatecaches --ignore-table=lorindafontainefarris.craft_templatecachecriteria --ignore-table=lorindafontainefarris.craft_templatecacheelements lorindafontainefarris >> "/Users/richardclark/Sites/lorindafontainefarris/storage/backups/lorinda-fontaine-farris_180327_135443_jfivi9ibwf_v3.0.0-rc16.1.sql"" failed with exit code 127: sh: mysqldump: command not found
  2018-03-27 09:54:43 [127.0.0.1][1][-][info][application] $_GET = [
      'p' => 'admin/actions/updater/backup'</p>
</blockquote>

<p>I tried adding a PATH reference to my export <code>PATH=$PATH:~/.local/bin/mysqldump</code> in the <code>.bash_profile</code> file, but that didn't seem to do anything. Do I have to add something to the <code>CraftValetDriver</code> file, or is my PATH reference incorrect?</p>

<p>Any help would be greatly appreciated.</p>

<p>Thanks,</p>

<p>Richard</p>

<database><craft3><updating><valet>
Craft 3 wont update in Laravel Valet development enviornment
# Craft 3 wont update in Laravel Valet development enviornment

(Asked by: username_0 on 2018-03-27)

I'm using Laravel Valet with Craft 3 (Craft 3.0.0-RC13) and Sequel Pro.

I can't seem to get Craft to update. I just get a warning sign and a message saying that it couldn't back up the database.

When I looked at my log file, it contained the following:

> FROM `craft_info`
> 2018-03-27 09:54:43 [127.0.0.1][1][-][error][craft\controllers\UpdaterController::actionBackup] Error backing up the database: The shell command "mysqldump --defaults-extra-file="/Users/richardclark/Sites/lorindafontainefarris/storage/runtime/temp/my.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --single-transaction --no-data --result-file="/Users/richardclark/Sites/lorindafontainefarris/storage/backups/lorinda-fontaine-farris\_180327\_135443\_jfivi9ibwf\_v3.0.0-rc16.1.sql" lorindafontainefarris && mysqldump --defaults-extra-file="/Users/richardclark/Sites/lorindafontainefarris/storage/runtime/temp/my.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --no-create-info --ignore-table=lorindafontainefarris.craft\_assetindexdata --ignore-table=lorindafontainefarris.craft\_assettransformindex --ignore-table=lorindafontainefarris.craft\_cache --ignore-table=lorindafontainefarris.craft\_sessions --ignore-table=lorindafontainefarris.craft\_templatecaches --ignore-table=lorindafontainefarris.craft\_templatecachecriteria --ignore-table=lorindafontainefarris.craft\_templatecacheelements lorindafontainefarris >> "/Users/richardclark/Sites/lorindafontainefarris/storage/backups/lorinda-fontaine-farris\_180327\_135443\_jfivi9ibwf\_v3.0.0-rc16.1.sql"" failed with exit code 127: sh: mysqldump: command not found
> 2018-03-27 09:54:43 [127.0.0.1][1][-][info][application] $\_GET = [
> 'p' => 'admin/actions/updater/backup'

I tried adding a PATH reference to my export `PATH=$PATH:~/.local/bin/mysqldump` in the `.bash_profile` file, but that didn't seem to do anything. Do I have to add something to the `CraftValetDriver` file, or is my PATH reference incorrect?

Any help would be greatly appreciated.

Thanks,

Richard

**Tags:** database, craft3, updating, valet


---

## 2 answers

### Answer by username_1 on 2018-03-28. Score: 1

I believe we were conversing via Medium yesterday on this issue.

Regarding your question, I know for a fact your PATH reference is incorrect. The path to mysqldump is never `~/.local/bin/mysqldump`; mine is located at `/usr/local/bin/mysqldump` (I'm using MariaDB).

***BUT*** since you said on Medium that you're using MySQL (instead of MariaDB or another database option), you should use this instead: `export PATH="/usr/local/mysql/bin:$PATH"`.

After you add that to your `.bash_profile` and either [source the file](https://stackoverflow.com/a/4608197/4914302) or quit and relaunch terminal, `mysqldump` should be working.


---

### Answer by username_2 on 2018-03-28. Score: 1

I don’t know if the following will help with Valet, but I ran into the same problem today with my local Homebrew dev server. Despite having /usr/local/bin in my PATH and mysqldump working just fine on the command line the backup task would fail.
Checking the PHP info page revealed that Apache was running with a PATH setting of /usr/bin:/bin:/usr/sbin:/sbin. So there’s your problem.
After trying various different approaches for setting envvars and getting nowhere I eventually found that setting the PATH via the Apache launch daemon file did the job, per this SO thread and this gist.
For my setup this meant editing /usr/local/opt/httpd/homebrew.mxcl.httpd.plist and adding the following within the main  tag:
  EnvironmentVariables
  
   PATH
   /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  

After adding that and running brew services restart httpd my PATH finally updated and the export task started working.

> **Comments:**
> **username_1**: Just a note, great info for future reference but the OP is not using Apache since he's working with Laravel Valet which is Nginx only.  
> **username_2**: Ah thanks, I should have checked that. I’ll leave the post up in case it helps anyone else looking to fix this error with their Apache setup.  

---

