Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3.4.0 with MySQL database

I have installed Python version 3.4.0 and I would like to do a project with MySQL database. I downloaded and tried installing MySQLdb, but it wasn't successful for this version of Python.

Any suggestions how could I fix this problem and install it properly?

like image 693
Srdan Ristic Avatar asked Apr 29 '14 22:04

Srdan Ristic


1 Answers

MySQLdb does not support Python 3 but it is not the only MySQL driver for Python.

mysqlclient is essentially just a fork of MySQLdb with Python 3 support merged in (and a few other improvements).

PyMySQL is a pure python MySQL driver, which means it is slower, but it does not require a compiled C component or MySQL libraries and header files to be installed on client machines. It has Python 3 support.

Another option is simply to use another database system like PostgreSQL.

like image 109
Andrew Gorcester Avatar answered Sep 22 '22 11:09

Andrew Gorcester