• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MySQLdb/H18-Nov-2021-5,1944,564

doc/H18-Nov-2021-1,218765

mysqlclient.egg-info/H03-May-2022-13599

tests/H18-Nov-2021-2,0961,580

HISTORY.rstH A D17-Nov-202114.6 KiB559341

LICENSEH A D23-Mar-201017.7 KiB340281

MANIFEST.inH A D08-Jan-2021261 1312

PKG-INFOH A D18-Nov-20214.3 KiB13599

README.mdH A D19-Oct-20213.1 KiB10168

metadata.cfgH A D17-Nov-20211.4 KiB4241

setup.cfgH A D18-Nov-202138 53

setup.pyH A D03-Jul-2020563 2316

setup_common.pyH A D19-Oct-20211 KiB3828

setup_posix.pyH A D31-May-20214.7 KiB169128

setup_windows.pyH A D19-Oct-20211.5 KiB6553

site.cfgH A D19-Oct-2021450 1310

README.md

1# mysqlclient
2
3This project is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1).
4This project adds Python 3 support and fixed many bugs.
5
6* PyPI: https://pypi.org/project/mysqlclient/
7* GitHub: https://github.com/PyMySQL/mysqlclient
8
9
10## Support
11
12**Do Not use Github Issue Tracker to ask help.  OSS Maintainer is not free tech support**
13
14When your question looks relating to Python rather than MySQL:
15
16* Python mailing list [python-list](https://mail.python.org/mailman/listinfo/python-list)
17* Slack [pythondev.slack.com](https://pyslackers.com/web/slack)
18
19Or when you have question about MySQL:
20
21* [MySQL Community on Slack](https://lefred.be/mysql-community-on-slack/)
22
23
24## Install
25
26### Windows
27
28Building mysqlclient on Windows is very hard.
29But there are some binary wheels you can install easily.
30
31If binary wheels do not exist for your version of Python, it may be possible to
32build from source, but if this does not work, **do not come asking for support.**
33To build from source, download the
34[MariaDB C Connector](https://mariadb.com/downloads/#connectors) and install
35it. It must be installed in the default location
36(usually "C:\Program Files\MariaDB\MariaDB Connector C" or
37"C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you
38build the connector yourself or install it in a different location, set the
39environment variable `MYSQLCLIENT_CONNECTOR` before installing. Once you have
40the connector installed and an appropriate version of Visual Studio for your
41version of Python:
42
43```
44$ pip install mysqlclient
45```
46
47### macOS (Homebrew)
48
49Install MySQL and mysqlclient:
50
51```
52# Assume you are activating Python 3 venv
53$ brew install mysql
54$ pip install mysqlclient
55```
56
57If you don't want to install MySQL server, you can use mysql-client instead:
58
59```
60# Assume you are activating Python 3 venv
61$ brew install mysql-client
62$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
63$ export PATH="/usr/local/opt/mysql-client/bin:$PATH"
64$ pip install mysqlclient
65```
66
67### Linux
68
69**Note that this is a basic step.  I can not support complete step for build for all
70environment.  If you can see some error, you should fix it by yourself, or ask for
71support in some user forum.  Don't file a issue on the issue tracker.**
72
73You may need to install the Python 3 and MySQL development headers and libraries like so:
74
75* `$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential`  # Debian / Ubuntu
76* `% sudo yum install python3-devel mysql-devel`  # Red Hat / CentOS
77
78Then you can install mysqlclient via pip now:
79
80```
81$ pip install mysqlclient
82```
83
84### Customize build (POSIX)
85
86mysqlclient uses `mysql_config` or `mariadb_config` by default for finding
87compiler/linker flags.
88
89You can use `MYSQLCLIENT_CFLAGS` and `MYSQLCLIENT_LDFLAGS` environment
90variables to customize compiler/linker options.
91
92```
93$ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags`
94$ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs`
95$ pip install mysqlclient
96```
97
98### Documentation
99
100Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/)
101