<p>Friends, I am learning here and trying to implement an init container which checks if MySQL is ready for connections. I have a pod running MySQL and another pod with an app which will connect to the MysSQL pod when its ready.</p>
<p>No success so far. The error I am getting is the following: <code>sh: mysql: not found</code>. This is how I am trying:</p>
<pre><code>initContainers:
- name: {{ .Values.initContainers.name }}
  image: {{ .Values.initContainers.image }}
  command:
  - &quot;sh&quot;
  - &quot;-c&quot;
  - &quot;until mysql --host=mysql.default.svc.cluster.local --user={MYSQL_USER} 
  --password={MYSQL_PASSWORD} --execute=\&quot;SELECT 1;\&quot;; do echo waiting for mysql; sleep 2; done;&quot; 
</code></pre>
<p>Any idea how I could make this work?</p>

marcelo
<p>Please try using this.</p>
<p>initContainers:</p>
<pre><code>    - name: init-cont

      image: busybox:1.31

      command: ['sh', '-c', 'echo -e &quot;Checking for the availability of MySQL Server deployment&quot;; while ! nc -z mysql 3306; do sleep 1; printf &quot;-&quot;; done; echo -e &quot;  &gt;&gt; MySQL DB Server has started&quot;;']
</code></pre>
