Description
MySQLdb is a Python DB API-2.0-compliant interface; see PEP-249 for details. For up-to-date versions of MySQLdb, use the homepage link.
Supported versions:
* MySQL versions from 3.23 to 5.5; 5.0 or newer recommended. MariaDB should also work.
* Python versions 2.4-2.7; Python 3 support coming soon.
ZMySQLDA is a Database Adapter for Zope2.
注意、MySQL数据库要用MySQLdb模块,但Python用来链接MySQL的第三方库MySQLdb不支持Python3.x
安装MySQLdb
下载 MySQL-python-1.2.4b4.tar.gz[root@localhost IdcCheck]# wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.4b4/MySQL-python-1.2.4b4.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmysql-python%2F&ts=1478767096&use_mirror=jaist .
[root@localhost IdcCheck]# tar -zxvf MySQL-python-1.2.4b4.tar.gz
解压缩[root@localhost IdcCheck]# tar -zxvf MySQL-python-1.2.4b4.tar.gz
执行
[root@localhost IdcCheck]# cd MySQL-python-1.2.4b4
编译
[root@localhost MySQL-python-1.2.4b4]# python setup.py build
安装[root@localhost MySQL-python-1.2.4b4]# python setup.py install
测试是否安装成功,执行如下代码不报错,则代表成功
[root@localhost IdcCheck]# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14)
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>