import MySQLdb db = MySQLdb.connect(db=dbname, host=dbhost, user=dbuser, passwd=dbpass) cursor = db.cursor() cursor.execute("SELECT NOW();") d = cursor.fetchone() print("Now: ", d[0]) db.close()