How to install mysql-connector via pip

Codefor picture Codefor · Sep 24, 2015 · Viewed 108.2k times · Source

I use sqlalchemy to access MySQL in my Python project. sqlalchemy's conf is like this:

dialect=mysql
driver=mysqlconnector

So I need to install the Python module mysql connector via pip. Any help?

Answer

Partha Sen picture Partha Sen · Jun 8, 2017

If loading via pip install mysql-connector and leads an error Unable to find Protobuf include directory then this would be useful pip install mysql-connector==2.1.4

mysql-connector is obsolete, so use pip install mysql-connector-python. Same here