title: Installing Mysql on a VM under Alpine
body: <p>I'm trying to install and use mysql on Alpine. I'm using Docker to generate a VM under Alpine.
  My Dockerfile is really simple :</p>
  <pre><code>FROM alpine:3.11.3
  
  CMD sh
  </code></pre>
  <p>Once I've run the image created (using docker build // docker run image_id), I install Mysql :</p>
  <pre><code>apk add --update --upgrade mysql mysql-client
  </code></pre>
  <p>Then, I install the database :</p>
  <pre><code>mysql_install_db
  </code></pre>
  <p>The problem is that once I've done that and I try to &quot;mysql&quot;, the machine returns this :</p>
  <pre><code>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
  </code></pre>
  <p>And when I try to do &quot;mysqld -u root&quot;, it returns me this problem :</p>
  <pre><code>2020-08-26 10:07:55 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
  2020-08-26 10:07:55 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
  2020-08-26 10:07:55 0 [ERROR] Can't start server : Bind on unix socket: No such file or directory
  2020-08-26 10:07:55 0 [ERROR] Do you already have another mysqld server running on socket: /run/mysqld/mysqld.sock ?
  2020-08-26 10:07:55 0 [ERROR] Aborting
  </code></pre>
  <p>I understood that the file mysqld.sock serves the server to discuss with the client. I tried to create the directory mysqld and then to create the file mysqld.sock but it doesn't work. It returns me the same error but with a different return value.</p>
  <pre><code>(ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (111)
  </code></pre>
  <p>At least, I don't want to use an existing image of mysql on Dockerhub.</p>
  <p>Do anybody has an idea of what step is missing to make it work ?</p>
  <p>Sorry if I'm not writing proper, I'm not a native english speaker.</p>