title: mysql:5.7 docker allow access from all hosts and create DB
body: <p><br>I got a problem with mysql:5.7 with Docker. I know there are many questions about this but I just can't get this to work. <br>I simply want to create a mysql:5.7 container with docker-compose with the following settings on STARTUP!!:</p>
  <ul>
  <li>Create user &quot;root&quot; with password &quot;mypw&quot;</li>
  <li>Allow access with root user from ALL hosts and containers</li>
  <li>Create a table named &quot;mytable&quot;</li>
  </ul>
  <p>My yml:</p>
  <pre><code>db:
   build: &quot;.&quot;
    command:
     - &quot;--default-authentication-plugin=mysql_native_password&quot;
    ports:
     - &quot;3306:3306&quot;
    environment:
     - MYSQL_ROOT_PASSWORD=&quot;mypw&quot;
    volumes:
     - &quot;./mysql/database:/var/lib/mysql&quot;
  </code></pre>
  <p>What i tried: <br></p>
  <ul>
  <li>Dockerfile: COPY ./mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf</li>
  <li>mysqld.cnf contains the line &quot;bind-address = 0.0.0.0&quot; at the end</li>
  <li>Add script to /docker-entrypoint-initdb.d/ with content &quot;CREATE DATABASE mydb;&quot;</li>
  <li>MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE variables (can't connect either)</li>
  <li>use skip-grant-tables in mysqld.cnf (errors)</li>
  <li>MYSQL_ROOT_HOST=&quot;%&quot;</li>
  </ul>
  <p>I just don't get why especially allow access from everywhere is so hard to do.<br>
  Can anyone please help with where to put what?<br>Thanks</p>