title: MySQLdb connection problems
body: <p>I'm having trouble with the MySQLdb module.</p>
  
  <pre><code>db = MySQLdb.connect(
      host = 'localhost', 
      user = 'root', 
      passwd = '', 
      db = 'testdb', 
      port = 3000)
  </code></pre>
  
  <p>(I'm using a custom port)</p>
  
  <p>the error I get is:</p>
  
  <pre>Error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)</pre>
  
  <p>Which doesn't make much sense since that's the default connection set in my.conf.. it's as though it's ignoring the connection info I give..</p>
  
  <p>The mysql server is definitely there:</p>
  
  <pre>
  [root@baster ~]# mysql -uroot -p -P3000
  Enter password: 
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 19
  Server version: 5.0.77 Source distribution
  
  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  
  mysql> use testdb;
  Database changed
  mysql> 
  </pre>
  
  <p>I tried directly from the python prompt:</p>
  
  <pre>
  >>> db = MySQLdb.connect(user='root', passwd='', port=3000, host='localhost', db='pyneoform')
  Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.5/site-packages/MySQLdb/__init__.py", line 74, in Connect
  return Connection(*args, **kwargs)
  File "/usr/lib64/python2.5/site-packages/MySQLdb/connections.py", line 169, in __init__
  super(Connection, self).__init__(*args, **kwargs2)
  _mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
  >>>
  </pre>
  
  <p>I'm confused... :(</p>