postgresql+pg8000://dbuser:kx%25jj5%2Fg@pghost10/appdb
-The encoding for the password can be generated using ``urllib``::
+The encoding for the above password can be generated using ``urllib``::
>>> import urllib.parse
>>> urllib.parse.quote_plus("kx%jj5/g")
# default
engine = create_engine('mysql://scott:tiger@localhost/foo')
- # mysql-python
+ # mysqlclient (a maintained fork of MySQL-Python)
engine = create_engine('mysql+mysqldb://scott:tiger@localhost/foo')
- # MySQL-connector-python
- engine = create_engine('mysql+mysqlconnector://scott:tiger@localhost/foo')
-
- # OurSQL
- engine = create_engine('mysql+oursql://scott:tiger@localhost/foo')
+ # PyMySQL
+ engine = create_engine('mysql+pymysql://scott:tiger@localhost/foo')
More notes on connecting to MySQL at :ref:`mysql_toplevel`.
And for an absolute file path, the three slashes are followed by the absolute path::
- #Unix/Mac - 4 initial slashes in total
+ # Unix/Mac - 4 initial slashes in total
engine = create_engine('sqlite:////absolute/path/to/foo.db')
- #Windows
+
+ # Windows
engine = create_engine('sqlite:///C:\\path\\to\\foo.db')
- #Windows alternative using raw string
+
+ # Windows alternative using raw string
engine = create_engine(r'sqlite:///C:\path\to\foo.db')
To use a SQLite ``:memory:`` database, specify an empty URL::
:members: __init__
-MySQL-Python
-------------
+mysqlclient (fork of MySQL-Python)
+----------------------------------
.. automodule:: sqlalchemy.dialects.mysql.mysqldb
-pymysql
+PyMySQL
-------
.. automodule:: sqlalchemy.dialects.mysql.pymysql
"""
.. dialect:: mysql+mysqldb
- :name: MySQL-Python
+ :name: mysqlclient (maintained fork of MySQL-Python)
:dbapi: mysqldb
:connectstring: mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
- :url: http://sourceforge.net/projects/mysql-python
+ :url: https://pypi.org/project/mysqlclient/
+
+Driver Status
+-------------
+
+The mysqlclient DBAPI is a maintained fork of the
+`MySQL-Python <http://sourceforge.net/projects/mysql-python>`_ DBAPI
+that is no longer maintained. `mysqlclient`_ supports Python 2 and Python 3
+and is very stable.
+
+.. _mysqlclient: https://github.com/PyMySQL/mysqlclient-python
.. _mysqldb_unicode:
Please see :ref:`mysql_unicode` for current recommendations on unicode
handling.
-Py3K Support
-------------
-
-Currently, MySQLdb only runs on Python 2 and development has been stopped.
-`mysqlclient`_ is fork of MySQLdb and provides Python 3 support as well
-as some bugfixes.
-
-.. _mysqlclient: https://github.com/PyMySQL/mysqlclient-python
Using MySQLdb with Google Cloud SQL
-----------------------------------