<p>Friends, I am trying to implement a readinessProbe here like this:</p>
<pre><code>readinessProbe:  
  exec:
    command: [&quot;mysql&quot;, &quot;-u root&quot;, &quot;-p $(MYSQL_ROOT_PASSWORD)&quot;, &quot;SHOW DATABASES;&quot;]
    initialDelaySeconds: 5
    periodSeconds: 2
    timeoutSeconds: 1
</code></pre>
<p>But I am getting an access denied error: <strong>ERROR 1045 (28000): Access denied for user ' root'@'localhost' (using password: YES)</strong></p>
<p>When I exec inside my pod, I can connect to the database normally so I think I am doing something wrong by the execution the the connection commands. Any idea how can I solve this problem?</p>

marcelo
<p>It worked for me like this:</p>
<pre><code>readinessProbe:
   exec:
      command:
      - &quot;bash&quot; 
      - &quot;-c&quot;
      - &quot;mysql --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --execute=\&quot;SHOW DATABASES;\&quot;&quot;
</code></pre>
<p>But I still don't know how to &quot;translate&quot; this if I want to use brackets.</p>
