Skip to content
CyMySQL: Python MySQL Client powered by Cython
Branch: master
Clone or download
Pull request Compare This branch is 555 commits ahead, 815 commits behind PyMySQL:master.
Latest commit 4edc14f Jan 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
cymysql revision number up Jan 10, 2019



What's CyMySQL

This package contains a python MySQL client library.

It is a fork project from PyMySQL

PyMySQL is written by Yutaka Matsubara <> as a pure python database driver.

CyMySQL accerarates by Cython, and support not only python 2 but also python 3. It still can work without Cython as a pure python driver.

It is maintained by Hajime Nakagami <>.

Documentation on the MySQL client/server protocol can be found here:


  • Python 2.6, 2.7, 3.3+
  • MySQL 5.5 or higher


Install cython (optional)

# pip install cython

Install cymysql

# pip install cymysql

MySQL 8.0 and insecure connection

If you use caching_sha2_password authentication plugin (MySQL 8.0 default) and connect with 'not ssl and not unix_socket' you shoud install pycryptodome

# pip install pycryptodome


import cymysql
conn = cymysql.connect(host='', user='root', passwd='', db='database_name')
cur = conn.cursor()
cur.execute('select foo, bar from baz')
for r in cur.fetchall():
   print(r[0], r[1])
You can’t perform that action at this time.