I am new at using raspberry pi. I have a python 3.4 program that connects to a database on hostinger server. I want to install mysql connector in raspberry pi.I searched a lot but I was not able to find answers . any help would be appreciated
Before you install, it is important to run update and upgrade;
sudo apt-get update
sudo apt-get upgrade
Either install connector for Python 2;
sudo apt-get -y install python-mysql.connector
Or install connector for Python 3;
sudo apt-get -y install python3-mysql.connector
I found no way to install mysql-connector-python that I used with windows. for python 3.4 I used the command
sudo python3 -m pip install pymysql
for python 2.7 you can use following commands
sudo apt-get install python-mysqldb
or
sudo apt-get install python-pip
pip install pymysql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With