<p>I have tried the database application for mysql and postgres too. When I use pv type as OSS, and deploy the application, pods goes in CrashbackLoopOff. The error which I am constantly getting is </p>

<pre><code>chown: changing ownership of '/var/lib/mysql/': Input/output error
</code></pre>

<p>(For PostgreSQL I get the same error with <code>var/lib/postgresql/data</code>.)</p>

<p>The path which it is giving error is of container.The ways which I tried is, before uploading files to OSS I changed the ownership of files and folders from 999 to root and then uploaded to OSS.
But then also I am getting this error for every database.
Please give me solution for this as I am stuck from longer time.
Thanks in Advance </p>

<p>If I understand you correctly there are few things you can do:</p>

<ol>
<li><p>Launch the db container as <code>root</code> and than <code>chown</code> the directory. In case of mysql if you still can't change it than try running <code>sudo chown -R mysql:mysql /var/lib/mysql</code> as <code>mysql:mysql</code> is the default ownership there.</p></li>
<li><p>Use <code>initContainer</code> in order to change the target folder to <code>/var/lib/mysql/</code></p></li>
<li><p>Use <code>securityContext</code> for <code>containers</code>. For example:</p></li>
</ol>

<pre><code>containers:
- name: mysql
  image: &lt;msql_image&gt;
  securityContext:
    runAsUser: 0
</code></pre>

<p>It should all also work for <code>postgresql</code>.</p>

<p>Please let me know if that helped. </p>
