title: Can not connect to database sonarqube with mysql in docker
body: <p>I try to install sonarqube with mysql in docker.</p>
  
  <ol>
  <li>Mysql</li>
  </ol>
  
  <p>```</p>
  
  <pre><code>$ docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --name mysql mysql
  $ docker exec -it mysql bash
  # mysql -uroot -proot
  mysql&gt; CREATE DATABASE sonar CHARACTER SET utf8;
  mysql&gt; CREATE USER 'sonar'@'localhost' IDENTIFIED BY 'sonar' PASSWORD EXPIRE NEVER;
  mysql&gt; GRANT ALL PRIVILEGES ON sonar.* TO 'sonar'@'localhost';
  mysql&gt; FLUSH PRIVILEGES;
  </code></pre>
  
  <p>```</p>
  
  <ol start="2">
  <li>SonarQube</li>
  </ol>
  
  <p>```</p>
  
  <pre><code>$ docker run -d --name SonarQube --link mysql:mysql -p 9000:9000 -p 9092:9092 \
  -e SONARQUBE_JDBC_USERNAME=sonar \
  -e SONARQUBE_JDBC_PASSWORD=sonar \
  -e "SONARQUBE_JDBC_URL=jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8&amp;rewriteBatchedStatements=true" \
    sonarqube
  </code></pre>
  
  <p>```</p>
  
  <p>Here is my error log.
  Give me a solution.
  Thankyou</p>
  
  <p><code>
      2018.08.10 12:53:37 ERROR web[][o.s.s.p.Platform] Web server startup failed
      java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
      at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:108)
      at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:75)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...
  </code></p>