我的编程空间,编程开发者的网络收藏夹
学习永远不晚

python 2.6.6安装MySQL-

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

python 2.6.6安装MySQL-

1.下载安装setuptools

[root@localhost opt]#wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz

[root@localhost opt]#tar xzf setuptools-0.6c8.tar.gz

[root@localhost setuptools-0.6c8]# python setup.py build

[root@localhost setuptools-0.6c8]# python setup.py install

2.下载安装MySQL-python

[root@localhost opt]# wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download

[root@localhost opt]# cd MySQL-python-1.2.3/

[root@localhost MySQL-python-1.2.3]# python setup.py build

报错信息:...

         _mysql.c:2091: error: ‘r’ undeclared (first use in this function)

         _mysql.c:2091: error: ‘_mysql_ResultObject’ has no member named ‘result’

         _mysql.c:2092: error: ‘_mysql_ResultObject’ has no member named ‘result’

         _mysql.c: In function ‘_mysql_ResultObject_dealloc’:

         _mysql.c:2100: warning: implicit declaration of function ‘mysql_free_result’

         _mysql.c:2100: error: ‘_mysql_ResultObject’ has no member named ‘result’

         _mysql.c: At top level:

         _mysql.c:2331: error: ‘_mysql_ConnectionObject’ has no member named ‘open’

         _mysql.c:2338: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’

         _mysql.c:2345: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’

         _mysql.c:2352: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’

         _mysql.c:2359: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’

         _mysql.c:2422: error: ‘_mysql_ResultObject’ has no member named ‘converter’

         _mysql.c:2422: error: initializer element is not constant

         _mysql.c:2422: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)

         _mysql.c: In function ‘_mysql_ConnectionObject_getattr’:

         _mysql.c:2444: error: ‘_mysql_ConnectionObject’ has no member named ‘open’

         error: command 'gcc' failed with exit status 1

解决方法:yum -y install mysql-devel libxml2 libxml2-dev libxslt* zlib gcc openssl

[root@localhost MySQL-python-1.2.3]# python setup.py install

3.测试

[root@localhost MySQL-python-1.2.3]# python

Python 2.6.6 (r266:84292, May 24 2013, 21:09:02)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import MySQLdb

/usr/local/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.pyc, but /opt/MySQL-python-1.2.3 is being added to sys.path

解决方法:

[root@localhost MySQL-python-1.2.3]# cd ..

[root@localhost opt]# python

Python 2.6.6 (r266:84292, May 24 2013, 21:09:02)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import MySQLdb

>>>


免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

python 2.6.6安装MySQL-

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

python 2.6.6安装MySQL-

1.下载安装setuptools[root@localhost opt]#wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz [r
2023-01-31

【Python】安装MySQL-pyth

// wget[root@wode006 tools]# wget https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip--2015-07
2023-01-31

pip安装MySQL-python


首先安装pipyum install python-setuptools python-setuptools-develeasy_install pip然后升级pip,安装setuptools合适的版本yum install mys
2023-01-31

python 安装 mysql-pyth

安装pip install MySQL-python 故障解决!   running build_ext    building '_mysql' extension    error: Microsoft Visual C++ 9.0 i
2023-01-31

安装MySQL-python报错

_mysql.c: 在函数‘DL_EXPORT’中:    _mysql.c:3058: 错误:expected declaration specifiers before ‘init_mysql’    _mysql.c:3166: 错误
2023-01-31

[python] mysql安装使用

下载安装MySQLdb 下载地址:http://pypi.python.org/simple/MySQL-python/<1>linux版本要先安装setuptools,然后在下载文件目录下,修改mysite.cfg,指定本地mysql的m
2023-01-31

python安装mysql的依赖包mysql-python操作

一般情况下,使用pip命令安装即可:[root@dthost27 ~]# pip install mysql-python但是在实际工作环境中,往往会安装失败,这是因为系统缺少mysql的相关依赖组件。所以必须先安装mysql-devel类
2022-05-24

mac下安装MySQL-python模块

今天电脑重装系统,所有软件都重装一遍,MySQLdb模块一直装不好,纠结了好久,终于解决,方法分享给大家,还有python三大神器之一的virtualenv使用。MySQLdb模块安装:    1、下载MySQL-pyhon模块,网站为:h
2023-01-31

安装Python 后安装Python-d

安装可能会失败用以下命令就ok了。1.sudo apt-get install aptitude2.sudo aptitude install python-dev
2023-01-31

2. MySQL之mysql-connector-python的安装使用

MySQL 是最流行的关系型数据库管理系统,关于数据库以及MySQL相关知识,此处不再赘述。本篇介绍使用 mysql-connector-python 来连接使用 MySQL。 1. 安装mysql-connector-python 执行
2023-08-20
2024-04-02

MySQL安装

原文链接http://zhhll.icu/2020/10/30/%E6%95%B0%E6%8D%AE%E5%BA%93/%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/MySQL/MySQL%E5%

	MySQL安装
2018-09-17
2024-04-02

python安装mysql-python简明笔记(ubuntu环境)

本文讲述了python安装mysql-python的方法。分享给大家供大家参考,具体如下: ubuntu 系统下进行的操作 首先安装了pip工具sudo apt-get install python-pip然后使用sudo pip inst
2022-06-04

Python -- 安装

小Q 等闲变却故人心却道故人心易变。                                                          --- 纳兰容若------------------------------------
2023-01-31

python安装

本章节我们将向大家介绍如何在本地搭建Python开发环境。Python可应用于多平台包括 Linux 和 Mac OS X。你可以通过终端窗口输入 "python" 命令来查看本地是否已经安装Python以及Python的安装版本。Unix
2023-01-31

编程热搜

目录