I believe the preferred way to connect to MySQL database from Python is with MySQLdb.
I'm relatively new to Python programming and it also seemed to be advised to write for Python 3, so I've been doing so.
But I can't see a python 3 package for mysqldb.
apt-cache show python-mysqldb says:
Depends: python (>= 2.6.6-7~), python (<< 2.8),
apt-cache search python3 | grep mysql
Gives no results.
How do I get started? Do I have to back-port my code to the old python? Thanks.
Edit after question was closed
So I thought this was to do with the Raspian repos not having the full complement of software, but it's just a Python thing and not related to RPI, so the editors were right to close the question.
However, if you've come across this, a great answer has been posed on stackoverflow before.
sudo apt-get install python-pip3 sudo pip3 install pymysql
Is what I went with.