<p>I tried to install mysq-client but got this error: <code>Package 'mysql-client' has no installation candidate</code> After installing <code>mariadb-client</code>, everything worked as expected!</p>

CC BY-SA 4.0
2021-05-28T11:11:49.960Z
2021-05-28T11:11:49.960Z
studio-pj
<p>Sounds like your php-fpm container 3 needs to install the MySQL client tools in it, so that <code>mysqldump</code> is available in the container similar to <a href="https://github.com/craftcms/docker/blob/main/7.4/dev.Dockerfile#L18" rel="nofollow noreferrer">https://github.com/craftcms/docker/blob/main/7.4/dev.Dockerfile#L18</a></p>

CC BY-SA 4.0
2021-05-26T17:20:04.597Z
2021-05-26T17:20:04.597Z
Brad Bell
<p>I'm running CraftCMS via 3 Docker containers in 1 Docker network:</p>
<ul>
<li><strong>Container 1</strong> - MySQL</li>
<li><strong>Container 2</strong> - Nginx</li>
<li><strong>Container 3</strong> - PHP:7.4-fpm</li>
</ul>
<p>When I run <code>php craft update craft</code> from <strong>container 3</strong> and choose to backup the db, I get this error:</p>
<pre class="lang-bash prettyprint-override"><code>Backup the database? (yes|no) [yes]:yes
Backing up the database ... error: The shell command &quot;mysqldump --defaults-extra-file=&quot;/tmp/hvncbmcornry.cnf&quot; --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-data --result-file=&quot;/app/storage/backups/my-site--2021-05-26-052145--v3.6.15.sql&quot; craftcms &amp;&amp; mysqldump --defaults-extra-file=&quot;/tmp/hvncbmcornry.cnf&quot; --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --no-create-info --ignore-table=craftcms.assetindexdata --ignore-table=craftcms.assettransformindex --ignore-table=craftcms.sessions --ignore-table=craftcms.templatecaches --ignore-table=craftcms.templatecachequeries --ignore-table=craftcms.templatecacheelements --ignore-table=craftcms.cache --ignore-table=craftcms.templatecachecriteria craftcms &gt;&gt; &quot;/app/storage/backups/my-site--2021-05-26-052145--v3.6.15.sql&quot;&quot; failed with exit code 127: sh: 1: mysqldump: not found
</code></pre>
<p>It looks like the <code>mysqldump</code> command doesn't exist in Container 3 as I don't get a result when running: <code>which mysqldump</code>. Running this <em>which</em> command from <strong>container 1</strong> does however return: <code>/usr/bin/mysqldump</code>. But in this container, I don't have access to my project.</p>

<database><mysql><updating>
Unable to backup the database or apply migrations
# Unable to backup the database or apply migrations

(Asked by: username_0 on 2021-05-26)

I'm running CraftCMS via 3 Docker containers in 1 Docker network:

Container 1 - MySQL
Container 2 - Nginx
Container 3 - PHP:7.4-fpm

When I run php craft update craft from container 3 and choose to backup the db, I get this error:
Backup the database? (yes|no) [yes]:yes
Backing up the database ... error: The shell command "mysqldump --defaults-extra-file="/tmp/hvncbmcornry.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-data --result-file="/app/storage/backups/my-site--2021-05-26-052145--v3.6.15.sql" craftcms && mysqldump --defaults-extra-file="/tmp/hvncbmcornry.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --no-create-info --ignore-table=craftcms.assetindexdata --ignore-table=craftcms.assettransformindex --ignore-table=craftcms.sessions --ignore-table=craftcms.templatecaches --ignore-table=craftcms.templatecachequeries --ignore-table=craftcms.templatecacheelements --ignore-table=craftcms.cache --ignore-table=craftcms.templatecachecriteria craftcms >> "/app/storage/backups/my-site--2021-05-26-052145--v3.6.15.sql"" failed with exit code 127: sh: 1: mysqldump: not found

It looks like the mysqldump command doesn't exist in Container 3 as I don't get a result when running: which mysqldump. Running this which command from container 1 does however return: /usr/bin/mysqldump. But in this container, I don't have access to my project.

**Tags:** database, mysql, updating


---

## 2 answers

### Answer by username_0 on 2021-05-28. Score: 0 | Accepted answer

I tried to install mysq-client but got this error: `Package 'mysql-client' has no installation candidate` After installing `mariadb-client`, everything worked as expected!


---

### Answer by username_1 on 2021-05-26. Score: 1

Sounds like your php-fpm container 3 needs to install the MySQL client tools in it, so that `mysqldump` is available in the container similar to <https://github.com/craftcms/docker/blob/main/7.4/dev.Dockerfile#L18>


---

