title: SpringBoot MySQL JDBC Unable to create initial connections of pool
body: <p>Good day!</p>
  
  <p>I have a simple springboot application with mysql jdbc repository.</p>
  
  <p>I have properties for connect to DB</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://*:3306/*?useSSL=false
  spring.datasource.username=*
  spring.datasource.password=*
  spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  spring.datasource.initialize=true
  spring.datasource.dbcp2.validation-query=SELECT 1
  spring.datasource.dbcp2.max-total=1
  </code></pre>
  
  <p>My test DB has only max 10 connections for user. When I use console </p>
  
  <pre><code>SHOW STATUS WHERE variable_name = 'threads_connected';
  </code></pre>
  
  <p>I can see that now DB has 5 connections only but when I try to start my application I get Exception </p>
  
  <blockquote>
    <p>2018-02-28 10:26:24.115 ERROR 17360 --- [nio-8080-exec-3]
    o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial
    connections of pool.</p>
    
    <p>java.sql.SQLSyntaxErrorException: User '*' has exceeded the
    'max_user_connections' resource (current value: 10)</p>
  </blockquote>
  
  <p>How can I fix it? And why I get that Exception if I have 5 free connetion on DB and I need only 1 connection for pool from properties? I can't edit max connection on DB because use Heroku like testDB. I can edit only tomcat properties only</p>