Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1906 from DanSears/master

Added description of MySQL Connector/Python
  • Loading branch information...
commit 15592a04d769782e0bd98f07e96ed1c406f51c01 2 parents dbbd10e + a17fc36
Aymeric Augustin authored November 11, 2013

Showing 1 changed file with 47 additions and 14 deletions. Show diff stats Hide diff stats

  1. 61  docs/ref/databases.txt
61  docs/ref/databases.txt
@@ -237,11 +237,38 @@ running ``migrate``::
237 237
    had reports that the Windows Community Server installer sets up InnoDB as
238 238
    the default storage engine, for example.
239 239
 
  240
+.. _mysql-db-api-drivers:
  241
+
  242
+MySQL DB API Drivers
  243
+--------------------
  244
+
  245
+The Python Database API is described in `PEP 249`_. MySQL has two prominent
  246
+drivers that implement this API:
  247
+
  248
+.. _PEP 249: http://www.python.org/dev/peps/pep-0249/
  249
+
  250
+- `MySQLdb`_ is a native driver that has been developed and supported for over
  251
+  a decade by Andy Dustman.
  252
+- `MySQL Connector/Python`_ is a pure Python driver from Oracle that does not
  253
+  require the MySQL client library or any Python modules outside the standard
  254
+  library.
  255
+
  256
+.. _MySQLdb: https://pypi.python.org/pypi/MySQL-python/1.2.4
  257
+.. _MySQL Connector/Python: http://dev.mysql.com/downloads/connector/python
  258
+
  259
+Both drivers are thread-safe and both provide connection pooling. The major
  260
+difference is that MySQL Connector/Python supports Python 3.
  261
+
  262
+In addition to a DB API driver, Django needs an adaptor to access the database
  263
+drivers from its ORM. Django provides an adaptor for MySQLdb while MySQL
  264
+Connector/Python includes `its own`_.
  265
+
  266
+.. _its own: http://dev.mysql.com/doc/refman/5.6/en/connector-python-django-backend.html
  267
+
240 268
 MySQLdb
241  
--------
  269
+~~~~~~~
242 270
 
243  
-`MySQLdb`_ is the Python interface to MySQL. Version 1.2.1p2 or later is
244  
-required for full MySQL support in Django.
  271
+Django requires MySQLdb version 1.2.1p2 or later.
245 272
 
246 273
 .. note::
247 274
     If you see ``ImportError: cannot import name ImmutableSet`` when trying to
@@ -253,25 +280,31 @@ required for full MySQL support in Django.
253 280
 
254 281
 .. note::
255 282
     There are known issues with the way MySQLdb converts date strings into
256  
-    datetime objects. Specifically, date strings with value 0000-00-00 are valid for
257  
-    MySQL but will be converted into None by MySQLdb.
  283
+    datetime objects. Specifically, date strings with value 0000-00-00 are
  284
+    valid for MySQL but will be converted into None by MySQLdb.
258 285
 
259 286
     This means you should be careful while using loaddata/dumpdata with rows
260 287
     that may have 0000-00-00 values, as they will be converted to None.
261 288
 
262  
-.. _MySQLdb: http://sourceforge.net/projects/mysql-python
  289
+.. note::
  290
+    At the time of writing, the latest release of MySQLdb (1.2.4) doesn't
  291
+    support Python 3. In order to use MySQLdb under Python 3, you'll have to
  292
+    install an unofficial fork, such as `MySQL-for-Python-3`_.
263 293
 
264  
-Python 3
265  
---------
  294
+    This port is still in alpha. In particular, it doesn't support binary
  295
+    data, making it impossible to use :class:`django.db.models.BinaryField`.
266 296
 
267  
-At the time of writing, the latest release of MySQLdb (1.2.4) doesn't support
268  
-Python 3. In order to use MySQL under Python 3, you'll have to install an
269  
-unofficial fork, such as `MySQL-for-Python-3`_.
  297
+.. _MySQL-for-Python-3: https://github.com/clelland/MySQL-for-Python-3
270 298
 
271  
-This port is still in alpha. In particular, it doesn't support binary data,
272  
-making it impossible to use :class:`django.db.models.BinaryField`.
  299
+MySQL Connector/Python
  300
+~~~~~~~~~~~~~~~~~~~~~~
273 301
 
274  
-.. _MySQL-for-Python-3: https://github.com/clelland/MySQL-for-Python-3
  302
+MySQL Connector/Python is available through two `release branches`_: Generally
  303
+Available (GA, currently 1.0.x) and Development (Dev, currently 1.1.x).
  304
+The Django adapter is currently available in the Dev branch and is described
  305
+as Alpha.
  306
+
  307
+.. _release branches: http://dev.mysql.com/downloads/connector/python/
275 308
 
276 309
 Creating your database
277 310
 ----------------------

0 notes on commit 15592a0

Please sign in to comment.
Something went wrong with that request. Please try again.