title: Connect to Database on Server using Python without putting Database password
body: <p>I have a situation as Follows..
  I am writing a python program.which asks users to enter username and password to begin with.Now I grab user name and password  from database  stored Online on web server Hoisted by GoDady and compare it with user entered Credentials .</p>
  
  <p>Approach I used to do so is as follows:</p>
  
  <pre><code>#!/usr/bin/python
  import MySQLdb
  
  db = MySQLdb.connect(host="localhost",    
                       user="john",         
                       passwd="megajonhy", 
                       db="jonhydb")       
  
  cur = db.cursor()    
  
  cur.execute("SELECT * FROM YOUR_TABLE_NAME")  
  
  for row in cur.fetchall():
      print row[0]
  
  db.close()
  </code></pre>
  
  <p>so as seen connection is made to database inside the program.for which i have to provide username and password of database inside the program.this method is not good if I want to give away my program to other.Because then I would like my users to input user Id and Password. and instead of connecting to database inside the program I want program to call a web-script which does it all for me and return if user is Authenticated user or not.</p>
  
  <p>what is the best approach to my scenario?</p>
  
  <p>Languages Used: Desktop Program (Python) : web(PHP) :Database(MYSQL)</p>