title: Interface Error of mysql
body: <p>I installed mysql <em>connector/python</em> and am using MAMP. When I try to connect to a database,this is what comes up in the terminal :</p>
  <pre><code>Traceback (most recent call last):
  File &quot;database.py&quot;, line 7, in &lt;module&gt;
      raise_on_warnings= True)
  File &quot;/Library/Python/2.7/site-packages/mysql/connector/__init__.py&quot;, line 179, in connect
          return MySQLConnection(*args, **kwargs)
    File &quot;/Library/Python/2.7/site-packages/mysql/connector/connection.py&quot;, line 95, in __init__
      self.connect(**kwargs)
    File &quot;/Library/Python/2.7/site-packages/mysql/connector/abstracts.py&quot;, line 719, in connect
      self._open_connection()
    File &quot;/Library/Python/2.7/site-packages/mysql/connector/connection.py&quot;, line 206, in _open_connection
      self._socket.open_connection()
    File &quot;/Library/Python/2.7/site-packages/mysql/connector/network.py&quot;, line 475, in open_connection
      errno=2003, values=(self.get_address(), _strioerror(err)))
  mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'localhost:8889:3306' (60 Operation timed out)
  </code></pre>
  <p>I tried going into the <em>connector folder</em> and checked out the network.py script and it seems the error is due to Interface Error. The documentation says:<br/></p>
  <blockquote>
  <p>This exception is raised for errors originating from Connector/Python itself, not related to the MySQL server.</p>
  <p>errors.InterfaceError is a subclass of errors.Error<br/></p>
  </blockquote>
  <p>Here's my python script if required:<br/></p>
  <pre><code>import mysql.connector
  
  con = mysql.connector.connect(user='root',
                                password ='root',
                                host='localhost',
                                database='testdb',
                                raise_on_warnings= True)
  
  cur = con.cursor()
  
  cur.close()
  con.close()
  </code></pre>
  <p>How to get rid of the interface error?</p>