Note
The PyODBC for MySQL dialect is not tested as part of SQLAlchemy's continuous integration. The recommended MySQL dialects are mysqlclient and PyMySQL. However, if you want to use the mysql+pyodbc dialect and require full support for utf8mb4 characters (including supplementary characters like emoji) be sure to use a current release of MySQL Connector/ODBC and specify the "ANSI" (not "Unicode") version of the driver in your DSN or connection string.
Pass through exact pyodbc connection string:
import urllib connection_string = ( 'DRIVER=MySQL ODBC 8.0 ANSI Driver;' 'SERVER=localhost;' 'PORT=3307;' 'DATABASE=mydb;' 'UID=root;' 'PWD=(whatever);' 'charset=utf8mb4;' ) params = urllib.parse.quote_plus(connection_string) connection_uri = "mysql+pyodbc:///?odbc_connect=%s" % params
Class | _pyodbcTIME |
Undocumented |
Class | MySQLDialect_pyodbc |
No class docstring; 0/4 class variable, 1/3 method documented |
Class | MySQLExecutionContext_pyodbc |
Undocumented |