title: Can`t connect MySQL database in phpMyAdmin by python
body: <p>I need to use python to connect database in phpMyAdmin.</p>
  
  <pre><code>import MySQLdb
  db = MySQLdb.connect(host="10.0.0.140",port=80,user="root",passwd="password")
  cursor=db.cursor()
  cursor.execute("SHOW DATABASES")
  results=cursor.fetchall()
  for result in results:
  print row
  </code></pre>
  
  <p>and I get this error </p>
  
  <pre><code>2013,"Lost connection to MySQL server at'waiting for initial communication packet',system error:0"
  </code></pre>
  
  <p>I can access the database in chrome, so I don`t think it is a problem of remote access.</p>
  
  <p>=======================update=======================</p>
  
  <p>The real reason is that I am in a limited net segment.(maybe)</p>
  
  <p>There is something wrong with SQL connection out of my code.</p>
  
  <p>If changed code like this:(port is not needed)</p>
  
  <pre><code>MySQLdb.connect(host="10.0.0.140",user="root",passwd="password")
  </code></pre>
  
  <p>People in public net segment can connect the phpMyAdmin but I can`t.</p>
  
  <p>I can not change my net segment so I can`t confirm it is the real reason.</p>
  
  <p>But it is the only difference between me and others.</p>