<p>目前正在维护用于Python的MySQL适配器:</p>
<ul>
<li><p><a href="https://github.com/PyMySQL/mysqlclient-python" rel="noreferrer">^{<cd1>}</a>-目前为止最快的MySQL连接器。需要<code>mysql-connector-c</code>C库才能工作。</p></li>
<li><p><a href="https://github.com/PyMySQL/PyMySQL" rel="noreferrer">^{<cd3>}</a>-纯Python MySQL客户端。<a href="https://github.com/PyMySQL/PyMySQL/issues/342#issuecomment-104939515" rel="noreferrer">According to the maintainer of both ^{<cd1>} and ^{<cd3>}</a>,您应该使用<code>PyMySQL</code>,如果:</p>
<ul>
<li>出于某种原因,您不能使用<code>libmysqlclient</code>。</li>
<li>您要使用gevent或eventlet的monkeypatched插座。</li>
<li>你不能破解mysql协议。</li>
</ul></li>
<li><p><a href="https://github.com/mysql/mysql-connector-python" rel="noreferrer">^{<cd8>}</a>-MySQL连接器是由Oracle的MySQL小组开发的,也是完全用Python编写的。它的表现似乎是三项中最差的。另外,由于一些许可问题,您不能从PyPI下载它(但现在可以通过conda获得)。</p></li>
</ul>
<h3>基准</h3>
<p>根据以下基准测试,<code>mysqlclient</code>比纯Python客户机更快(有时快10倍)。</p>
<ul>
<li><a href="https://gist.github.com/methane/90ec97dda7fa9c7c4ef1" rel="noreferrer">Benchmarking MySQL drivers (Python 3.4)</a></li>
<li><a href="https://wiki.openstack.org/wiki/PyMySQL_evaluation" rel="noreferrer">PyMySQL Evaluation</a></li>
<li><a href="http://charlesnagy.info/it/python/python-mysqldb-vs-mysql-connector-query-performance" rel="noreferrer">Python MySQLdb vs mysql-connector query performance</a></li>
</ul>