title: How to create a mysql connection pool or any better way to initialize the multiple databases?
body: <p>In my code I am opening two mysql connections and using HTTP requests to insert data into database</p>
  
  <pre><code>g.db = mysql.connector.connect(user=a ,password=password, host=localhost,database=mysq1)
  g.db1 = mysql.connector.connect(user=b,password=password, host=localhost,database=mysql2)
  
  @app.route('/user/&lt;db&gt;')  
  def insert(db):
     #code for inserting data into mysql1 database
     #code for inserting data into mysql2 database
  </code></pre>
  
  <p>I am making HTTP requests to select the databases.</p>
  
  <pre><code>  curl -i 'localhost:5000/user/mysql1' #
  </code></pre>
  
  <p>It is working well, data is getting inserted into the selected database.
  But I was thinking of creating a connection pool for the two connections and then used that pool.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>How to implement the mysql connection pooling?</p></li>
  <li><p>Is there other better way of initializing connections.Currently connection get opened at each request.</p></li>
  </ol>