import _mysql db = _mysql.connect(”hostname”, ”username”, ”password”, ”database”) db.query('''CREATE TABLE IF NOT EXISTS users(id INTEGER PRIMARY KEY, name VARCHAR(255), email VARCHAR(255))''') In python, no return value from query(), but exceptions possible. Results res = db.store_result() #held in client res = db.use_result() #held in server res.fetchrow(max_rows) res.fetchrow() fetchrow() will never return more than max_rows. Without a parameter the number is 1.