title: Cannot connect mysql through python
body: <p>I did a python -m pip install mysql-connector and able to successfully run <code>import mysql.connector</code> through python. But when I am trying to run the below code.</p>
  
  <pre><code>import mysql.connector
  
  mydb = mysql.connector.connect(
    host="localhost",
    user="yourusername",
    passwd="yourpassword"
  )
  
  print(mydb)
  </code></pre>
  
  <p>It is failing with <strong>InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (10061 No connection could be made because the target machine actively refused it)</strong> </p>
  
  <p>Since I did pip install for mysql.connector I am not sure of user and passwd.</p>