title: TypeError: cannot pickle '_mysql_connector.MySQL' object
body: <p>Throwing TypeError: cannot pickle '_mysql_connector.MySQL' object while running with multiprocessing map function</p>
  <pre class="lang-py prettyprint-override"><code>   from multiprocessing import Pool
     THREADS_COUNT = 20
     p = Pool(THREADS_COUNT)
     raw_stats = p.map(self.GetServerData,self.data) # p.map(fun,list_data)
  </code></pre>
  <pre><code>File &quot;dataservice/get_client.py&quot;, line 149, in GetClientLocation
      raw_stats = p.map(self.GetServerData,self.data)
    File &quot;/usr/lib/python3.10/multiprocessing/pool.py&quot;, line 364, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File &quot;/usr/lib/python3.10/multiprocessing/pool.py&quot;, line 771, in get
      raise self._value
    File &quot;/usr/lib/python3.10/multiprocessing/pool.py&quot;, line 537, in _handle_tasks
      put(task)
    File &quot;/usr/lib/python3.10/multiprocessing/connection.py&quot;, line 211, in send
      self._send_bytes(_ForkingPickler.dumps(obj))
    File &quot;/usr/lib/python3.10/multiprocessing/reduction.py&quot;, line 51, in dumps
      cls(buf, protocol).dump(obj)
  TypeError: cannot pickle '_mysql_connector.MySQL' object
  </code></pre>