I have been trying to use MySQL in a Python project I've been working on. I downloaded the connector: mysql-connector-python-2.1.3-py3.4-winx64
here.
I already had Python 3.5.1 installed. When I tried to install the connector, it didn't work because it required python 2.7 instead. I have searched on many sites, even on StackOverflow I couldn't find a solution.
Thanks for any help.
Try this link: MySQL - Downloads - Connector - Python
From
Select Platform
, select theplatform independent
an download MySQLconnector.After extracting the file go to its directory where setup.py is located.
WINDOWS: press shift + right_click and open command windows and type:
I was facing mysql database connection problem with Windows, Python 3.5.2 and Django. But finally I resolved it by installing "mysqlclient‑1.3.9‑cp35‑cp35m‑win32.whl" from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
Download the whl file, then enter into same directory in command prompt and run the below command.
pip install mysqlclient-1.3.9-cp35-cp35m-win32.whl
Note: Python 3.5.2 does not have official support for MySQL yet, so its just un-official binary to over come this problem for now.
Hope that will help you !!!
Use the mysqlclient library. Install with:
pip install mysqlclient
It is a fork of MySQLdb ( which was formerly installed via
pip install mysql-python
) that supports Python 3.*This library talks to the MySQL client's C-interface, and is faster than the pure-python
pymysql
libray.*Note: you will need the mysql-developer tools installed. An easy way to do this on a Mac is to run
brew install mysql
to delegate this task to homebrew. If you are on linux, you can install these via the instructions at themysqlclient
github page.I am using Python 3.5.2 on window 8 pro 64-bit and the following procedure is worked for me.
Download driver (PyMySQL-0.7.9.tar.gz (md5)) from here
Extract and copy the folder pymysql into the python Lib folder e.g (C:\Users\MyUsername\AppData\Local\Programs\Python\Python35-32\Lib)
I hope it will work for you as well. Happy coding :)
In
Windows
, I used:Visit this web site and you will find a mysqld package that works fine with Python 3 on Windows : http://www.lfd.uci.edu/~gohlke/pythonlibs/
Otherwise you can use pymysql which might be slower but works fine with Python 3.