python-mysqlclient/README.md

48 lines
1.5 KiB
Markdown
Raw Normal View History

2020-02-14 16:52:58 +08:00
# mysqlclient
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
[![Build Status](https://secure.travis-ci.org/PyMySQL/mysqlclient-python.png)](http://travis-ci.org/PyMySQL/mysqlclient-python)
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
This is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1).
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
This project adds Python 3 support and bug fixes.
I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools.
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
## Install
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
### Prerequisites
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
You may need to install the Python and MySQL development headers and libraries like so:
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
`sudo apt-get install python-dev libmysqlclient-dev` # Debian / Ubuntu
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
`sudo yum install python-devel mysql-devel` # Red Hat / CentOS
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
On Windows, there are binary wheel you can install without MySQLConnector/C or MSVC.
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
#### Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command :
2020-02-14 16:14:43 +08:00
2020-02-14 16:52:58 +08:00
`sudo apt-get install python3-dev` # debian / Ubuntu
`sudo yum install python3-devel ` # Red Hat / CentOS
`brew install mysql-connector-c` # macOS (Homebrew)
### Install from PyPI
`pip install mysqlclient`
NOTE: Wheels for Windows may be not released with source package. You should pin version
in your `requirements.txt` to avoid trying to install newest source package.
### Install from source
1. Download source by `git clone` or [zipfile](https://github.com/PyMySQL/mysqlclient-python/archive/master.zip).
2. Customize `site.cfg`
3. `python setup.py install`
### Documentation
Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/)
2020-02-14 16:14:43 +08:00