本文介绍了Python和MySQL:有没有MySQLdb的替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个纯粹用Python编写的模块,它允许脚本与MySQL数据库通信?我已经尝试MySQLdb没有成功。它需要太多:GCC,zlib和openssl。我没有访问这些工具;即使我做了,我不想浪费时间让他们一起工作。我正在寻找可以使我的工作更轻松的工具。

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.

有人能指出我用Python编写的Python Python模块的方向吗?

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.

感谢,

Tony

感谢大家的答案。由于我使用一个小数据库(几百个记录,主要是名称和地址),我决定使用SQLite。我刚刚发现了。它似乎完全适合我的目的;它是简单的安装(花了大约两分钟),并与Python很好地工作。我困惑于Python 2.4,所以我不能使用sqlite3模块,但我能够通过使用Python的'subprocess.Popen'函数和命令行参数与数据库通信。

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.

推荐答案

Sun有一个项目来实现100%的python mysql驱动程序。

There's a project at Sun to implement 100% python mysql driver.

我还没有找到任何代码。但根据,它比蒸汽软件更多。

I haven't found any code for it though. But according to a blog comment, it's more than vaporware.

这篇关于Python和MySQL:有没有MySQLdb的替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 17:30
查看更多