title: python connect to mySql error-ConnectionRefusedError: [WinError 10061]
body: <p>I tried to connect mySql server, using python, this is my code(of course I changed the dataBase details to fake ones):</p>
  
  <pre><code>    import pymysql
      connMySql= pymysql.connect (
      host = "blahblah.ipagemysql.com",
      user = "blah",
      passwd = "1234",
      db = "db_book")
  
      cur = connMySql.cursor()
      print ("writing to db")
      connMySql.commit()
  </code></pre>
  
  <p>this program give this following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\user\AppData\Roaming\Python\Python34\site-packages\pymysql\connections.py", line 836, in connect
      (self.host, self.port), self.connect_timeout)
    File "C:\Python34\lib\socket.py", line 509, in create_connection
      raise err
    File "C:\Python34\lib\socket.py", line 500, in create_connection
      sock.connect(sa)
  ConnectionRefusedError: [WinError 10061]
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:/Users/user/PycharmProjects/proj/projpy.py", line 432, in &lt;module&gt;
      db = "db_book")
    File "C:\Users\user\AppData\Roaming\Python\Python34\site-packages\pymysql\__init__.py", line 88, in Connect
      return Connection(*args, **kwargs)
    File "C:\Users\user\AppData\Roaming\Python\Python34\site-packages\pymysql\connections.py", line 657, in __init__
      self.connect()
    File "C:\Users\user\AppData\Roaming\Python\Python34\site-packages\pymysql\connections.py", line 882, in connect
      raise exc
  pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'blahblah.ipagemysql.com' ([WinError 10061] \u200f\u200f)")
  </code></pre>
  
  <p>any idea how to solve it?</p>