title: How to resolve Too many connections
body: <p>when I run this I get <code>Too many connections error</code> unfortunately I couldn't find the solution, I will generate 50 million data</p>
  <p>main.go content</p>
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      &quot;dopinghafiza-videoplayer-mysql/mysql&quot;
      _ &quot;github.com/go-sql-driver/mysql&quot;
  )
  
  func main() {
      
  
      var player mysql.Player
  
      player.Muted = 1
      player.UserId = 55
      player.PlayBackRate = &quot;2.55&quot;
      player.Volume = &quot;4.5888&quot;
      player.Volume = &quot;2.55&quot;
  
      connection := mysql.GetConnection()
  
      for i := 0; i &lt; 100000; i++ {
          player.Muted = int8(i % 2)
          player.UserId = i
          mysql.InsertPlayer(player, connection)
  
      }
  
  }
  
  </code></pre>
  <p>insert.go file content</p>
  <pre class="lang-golang prettyprint-override"><code>
  package mysql
  
  import (
      &quot;database/sql&quot;
      &quot;fmt&quot;
      _ &quot;github.com/go-sql-driver/mysql&quot;
  )
  
  type Player struct {
      UserId       int
      Muted        int8
      PlayBackRate string
      Volume       string
  }
  
  func InsertPlayer(player Player, db *sql.DB) {
  
      res := db.QueryRow(&quot;insert into players (muted,user_id,volume,play_back_rate) values (?,?,?,?)&quot;, player.Muted, player.UserId, player.Volume, player.PlayBackRate)
      db.Close()
      fmt.Println(res)
  }
  
  
  </code></pre>