<p>I'm struggling with import dump via <code>kubectl</code> to MySql database running in Kubernetes. There is no error output, but also no data imported.</p>
<p>Here is proof that there is such pod, also dump file on disk root called <code>/database.sql</code> and command.</p>
<pre><code>root@node-1:~# kubectl get pods -n esopa-test | grep mariadb
esopa-test-mariadb-0                    1/1     Running     0          14d
root@node-1:~# ll /database.sql 
-rw-r--r-- 1 root root 4418347 Oct 14 08:50 /database.sql
root@node-1:~# kubectl exec esopa-test-mariadb-0 -n esopa-test -- mysql -u root -proot database &lt; /database.sql 
root@node-1:~# 
</code></pre>
<p>Thank you for any advice</p>

Mariyo
<p>You can copy files from a pod to node by using <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp" rel="nofollow noreferrer"><code>kubectl cp</code></a> command.</p>
<p>To copy files from pod to node syntax is very simple:</p>
<pre><code>kubectl cp &lt;some-namespace&gt;/&lt;some-pod&gt;:&lt;directory-inside-pod&gt; &lt;directory_on_your_node&gt;
</code></pre>
<p>So in your use case you can use following command:</p>
<pre><code>kubectl cp esopa-test/esopa-test-mariadb-0:/database.sql &lt;directory_on_your_node&gt;
</code></pre>
<p>And to copy files from node to pod you can use:</p>
<pre><code>kubectl cp &lt;directory_on_your_node&gt; esopa-test/esopa-test-mariadb-0:/database.sql 
</code></pre>
