On Sat, Feb 8, 2014 at 7:52 PM, Sam <lightai...@gmail.com> wrote:
> I am writing my first python script to access MySQL database. With reference 
> to http://mysql-python.sourceforge.net/MySQLdb.html#connection-objects
>
> Why is it advisable to use _mysql and not MySQLdb module directly?

Other way around. It's advisable to ignore _mysql, which is a fairly
direct representation of the MySQL C API, and use MySQLdb instead.
When you use MySQLdb, you can fairly easily switch over to another
database engine (like PostgreSQL, which for most purposes is superior
to MySQL anyway), without changing most of your code. The only reason
to use _mysql would be if you need your code to be really similar to
other MySQL code in some other language - maybe you're using Python to
prototype a C application, and want to keep everything as close as you
can. Normally, use the higher level module.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to