title: Python | MySQL | AttributeError: module 'mysql.connector' has no attribute 'connect'
body: <p>I am learning a new library mysql in python. I have tried executing the below command,</p>
  
  <pre><code>import mysql.connector
  
  mydb= mysql.connector.connect(
              host= 'localhost',
              user= 'root',
              passwd= 'skviknesh'
              )
  print(mydb)
  </code></pre>
  
  <p>and got the below error!</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-1-f9b9bc67dd68&gt;", line 3, in &lt;module&gt;
      mydb= mysql.connector.connect(
  
  AttributeError: module 'mysql.connector' has no attribute 'connect'
  </code></pre>
  
  <p>I looked into similar other Stack overflow questions... Didn't get a solution. 
  I tried renaming my file too, that didn't help. 
  Please help on the same!!!</p>