import MySQLdb conn=MySQLdb.connect(user="root",passwd="",db="somedb") curs=conn.cursor() curs.execute("""select * from foobar""") allezeilen=curs.fetchall() conn.close()