Is there a module written purely in Python that will allow a script to communicate with a MySQL database? I've already tried MySQLdb without success. It requires too much: GCC, zlib, and openssl. I do not have access to these tools; even if I did, I don't want to waste time getting them to work together. I'm looking for tools that will make my work easier.
Can someone point me in the direction of a MySQL Python module written in Python? If not, tips on writing my own code for communicating with MySQL would be appreciated.
Thanks,
Tony
Thanks everyone for your answers. Since I'm working with a small database (a few hundred records, mainly names and addresses) I've decided to use SQLite. I just discovered it. It seems to be perfectly suited for my purposes; it was simple to install (took about two minutes) and works well with Python. I'm stuck with Python 2.4 so I can't use the sqlite3 module, but I'm able to communicate with the database by using Python's 'subprocess.Popen' function and command-line parameters.
Benchmarks. According to the following benchmarks, mysqlclient is faster (sometimes > 10x faster) than the pure Python clients. So looks like PyMySQL is still the way to go if using PyPy.
MySQL server will provide all the services required for handling your database. Once the server is up and running, you can connect your Python application with it using MySQL Connector/Python.
MySQL Connector/Python 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, and 5.6.
You've looked at these?
http://wiki.python.org/moin/MySQL
Lately there is also oursql (docs), which has various advantages over MySQLdb and other existing drivers -- listed at the top of the documentation.
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