Mysqldb Tutorial

03 Dec 2015

It is interface between python application and Mysql database.

Connection :
import _mysql
db=_mysql.connect(hostname,usrname,password,init_database)

Querying :

  1. db.query(sql)
    r=db.store_result() #return immediately; not good for large results
    # ...or...
    r=db.use_result() #return row by row from resultSet from server
    r.fetch_row()

Data Binding :
db.query("select * from person where name = %s",name)