python2.6.6安装MySQL-python模块正确方法

Centos6.5 x64 系统python2.6.6安装MySQL-python模块

一、安装前准备
操作系统:centos6.5 x64
·安装python和python开发工具
   python python-devel
·安装mysql-server和mysql开发工具
   mysql-server mysql mysql-devel
yum -y install mysql-devel libxml2 libxml2-dev libxslt* zlib gcc openssl

1.下载安装setuptools
  wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz
[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]$ sudo python setup.py build
[root@localhost MySQL-python-1.2.3]$ sudo python setup.py install

以上即可安装成功

二、安装过程中遇到的错误
查找了原因是因为没有安装mysql和python开发环境。
解决方法: sudo yum install python-devel mysql-devel
然后在安装一次即可成功
[root@localhost MySQL-python-1.2.3]# python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.6/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-x86_64-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX
在包含自 _mysql.c:29 的文件中:
pymemcompat.h:10:20: 错误:Python.h:没有那个文件或目录
_mysql.c:30:26: 错误:structmember.h:没有那个文件或目录
_mysql.c:62: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:63: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:64: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:65: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:66: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:67: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:68: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:69: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:70: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:71: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:72: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:75: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:85: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:88: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:96: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:105: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:227: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:318: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:336: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:359: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:360: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: 在函数‘_mysql_ResultObject_Initialize’中:
_mysql.c:362: 错误:‘NULL’未声明(在此函数内第一次使用)
_mysql.c:362: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
_mysql.c:362: 错误:所在的函数内也只报告一次。)
_mysql.c:364: 警告:从不兼容的指针类型初始化
_mysql.c:366: 错误:‘PyObject’未声明(在此函数内第一次使用)
_mysql.c:366: 错误:‘conv’未声明(在此函数内第一次使用)
_mysql.c:366: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:366: 警告:语句不起作用
_mysql.c:370: 警告:隐式声明函数‘PyArg_ParseTupleAndKeywords’
_mysql.c:370: 错误:‘args’未声明(在此函数内第一次使用)
_mysql.c:370: 错误:‘kwargs’未声明(在此函数内第一次使用)
_mysql.c:373: 警告:隐式声明函数‘PyDict_New’
_mysql.c:373: 警告:语句不起作用
_mysql.c:375: 错误:‘_mysql_ResultObject’没有名为‘conn’的成员
_mysql.c:375: 错误:expected expression before ‘)’ token
_mysql.c:375: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:375: 警告:语句不起作用
_mysql.c:376: 警告:隐式声明函数‘Py_INCREF’
_mysql.c:377: 错误:‘_mysql_ResultObject’没有名为‘use’的成员
_mysql.c:377: 警告:语句不起作用
_mysql.c:378: 错误:‘Py_BEGIN_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:378: 警告:语句不起作用
_mysql.c:380: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:380: 警告:传递‘mysql_use_result’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:458: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:382: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:382: 警告:传递‘mysql_store_result’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:457: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:383: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c:383: 警告:语句不起作用
_mysql.c:384: 错误:‘Py_END_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:384: 警告:语句不起作用
_mysql.c:386: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c:386: 警告:隐式声明函数‘PyTuple_New’
_mysql.c:386: 警告:语句不起作用
_mysql.c:390: 错误:‘_mysql_ResultObject’没有名为‘nfields’的成员
_mysql.c:390: 警告:语句不起作用
_mysql.c:391: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c:394: 错误:‘tmp’未声明(在此函数内第一次使用)
_mysql.c:394: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:394: 错误:‘fun’未声明(在此函数内第一次使用)
_mysql.c:394: 警告:逗号表达式的左操作数不起作用
_mysql.c:394: 警告:语句不起作用
_mysql.c:395: 警告:隐式声明函数‘PyInt_FromLong’
_mysql.c:395: 警告:语句不起作用
_mysql.c:397: 警告:隐式声明函数‘PyObject_GetItem’
_mysql.c:397: 警告:语句不起作用
_mysql.c:398: 警告:隐式声明函数‘Py_DECREF’
_mysql.c:400: 警告:隐式声明函数‘PyErr_Clear’
_mysql.c:401: 错误:‘Py_None’未声明(在此函数内第一次使用)
_mysql.c:401: 警告:语句不起作用
_mysql.c:404: 警告:隐式声明函数‘PySequence_Check’
_mysql.c:405: 警告:隐式声明函数‘PySequence_Size’
_mysql.c:406: 错误:‘fun2’未声明(在此函数内第一次使用)
_mysql.c:406: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:406: 警告:语句不起作用
_mysql.c:408: 错误:‘t’未声明(在此函数内第一次使用)
_mysql.c:408: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:408: 警告:隐式声明函数‘PySequence_GetItem’
_mysql.c:408: 警告:语句不起作用
_mysql.c:410: 警告:隐式声明函数‘PyTuple_Check’
_mysql.c:411: 警告:隐式声明函数‘PyTuple_GET_SIZE’
_mysql.c:413: 错误:‘pmask’未声明(在此函数内第一次使用)
_mysql.c:413: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:413: 警告:语句不起作用
_mysql.c:414: 警告:隐式声明函数‘PyTuple_GET_ITEM’
_mysql.c:414: 警告:语句不起作用
_mysql.c:415: 警告:语句不起作用
_mysql.c:416: 警告:隐式声明函数‘PyInt_Check’
_mysql.c:417: 警告:隐式声明函数‘PyInt_AS_LONG’
_mysql.c:433: 警告:语句不起作用
_mysql.c:436: 警告:语句不起作用
_mysql.c:438: 警告:隐式声明函数‘PyTuple_SET_ITEM’
_mysql.c:438: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c: 在函数‘_mysql_ResultObject_clear’中:
_mysql.c:462: 警告:隐式声明函数‘Py_XDECREF’
_mysql.c:462: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c:463: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c:463: 错误:‘NULL’未声明(在此函数内第一次使用)
_mysql.c:463: 警告:语句不起作用
_mysql.c:464: 错误:‘_mysql_ResultObject’没有名为‘conn’的成员
_mysql.c:465: 错误:‘_mysql_ResultObject’没有名为‘conn’的成员
_mysql.c:465: 警告:语句不起作用
_mysql.c: 在文件层:
_mysql.c:472: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:473: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: 在函数‘_mysql_ConnectionObject_Initialize’中:
_mysql.c:475: 错误:‘NULL’未声明(在此函数内第一次使用)
_mysql.c:475: 警告:从不兼容的指针类型初始化
_mysql.c:476: 错误:‘PyObject’未声明(在此函数内第一次使用)
_mysql.c:476: 错误:‘conv’未声明(在此函数内第一次使用)
_mysql.c:476: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:476: 警告:语句不起作用
_mysql.c:477: 错误:‘ssl’未声明(在此函数内第一次使用)
_mysql.c:477: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:477: 警告:语句不起作用
_mysql.c:479: 警告:从不兼容的指针类型初始化
_mysql.c:479: 警告:从不兼容的指针类型初始化
_mysql.c:479: 警告:从不兼容的指针类型初始化
_mysql.c:480: 警告:从不兼容的指针类型初始化
_mysql.c:480: 警告:从不兼容的指针类型初始化
_mysql.c:482: 警告:从不兼容的指针类型初始化
_mysql.c:482: 警告:从不兼容的指针类型初始化
_mysql.c:482: 警告:从不兼容的指针类型初始化
_mysql.c:483: 警告:从不兼容的指针类型初始化
_mysql.c:483: 警告:从不兼容的指针类型初始化
_mysql.c:493: 错误:初始值设定元素不是常量
_mysql.c:493: 错误:(在‘kwlist[16]’的初始化附近)
_mysql.c:496: 警告:从不兼容的指针类型初始化
_mysql.c:497: 警告:从不兼容的指针类型初始化
_mysql.c:498: 警告:从不兼容的指针类型初始化
_mysql.c:500: 错误:‘_mysql_ConnectionObject’没有名为‘converter’的成员
_mysql.c:500: 警告:语句不起作用
_mysql.c:501: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
_mysql.c:501: 警告:语句不起作用
_mysql.c:502: 警告:隐式声明函数‘_mysql_Exception’
_mysql.c:503: 错误:‘args’未声明(在此函数内第一次使用)
_mysql.c:503: 错误:‘kwargs’未声明(在此函数内第一次使用)
_mysql.c:523: 错误:‘value’未声明(在此函数内第一次使用)
_mysql.c:523: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:523: 警告:语句不起作用
_mysql.c:524: 警告:隐式声明函数‘PyMapping_GetItemString’
_mysql.c:524: 警告:语句不起作用
_mysql.c:524: 警告:隐式声明函数‘PyString_AsString’
_mysql.c:524: 警告:赋值时将整数赋给指针,未作类型转换
_mysql.c:525: 警告:语句不起作用
_mysql.c:525: 警告:赋值时将整数赋给指针,未作类型转换
_mysql.c:526: 警告:语句不起作用
_mysql.c:526: 警告:赋值时将整数赋给指针,未作类型转换
_mysql.c:527: 警告:语句不起作用
_mysql.c:527: 警告:赋值时将整数赋给指针,未作类型转换
_mysql.c:528: 警告:语句不起作用
_mysql.c:528: 警告:赋值时将整数赋给指针,未作类型转换
_mysql.c:536: 错误:‘Py_BEGIN_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:536: 警告:语句不起作用
_mysql.c:537: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:537: 警告:传递‘mysql_init’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:437: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:540: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:541: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:544: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:544: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:548: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:548: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:549: 警告:比较不相关的指针时缺少类型转换
_mysql.c:550: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:550: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:551: 警告:比较不相关的指针时缺少类型转换
_mysql.c:552: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:552: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:553: 警告:比较不相关的指针时缺少类型转换
_mysql.c:554: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:554: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:557: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:557: 警告:传递‘mysql_options’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:543: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:561: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:562: 警告:传递‘mysql_ssl_set’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:438: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:565: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:566: 警告:传递‘mysql_real_connect’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:444: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:568: 错误:‘Py_END_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:568: 警告:语句不起作用
_mysql.c:577: 警告:语句不起作用
_mysql.c:583: 错误:‘_mysql_ConnectionObject’没有名为‘converter’的成员
_mysql.c:583: 警告:语句不起作用
_mysql.c:591: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
_mysql.c:591: 警告:语句不起作用
_mysql.c: 在文件层:
_mysql.c:649: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: 在函数‘_mysql_ConnectionObject_clear’中:
_mysql.c:681: 错误:‘_mysql_ConnectionObject’没有名为‘converter’的成员
_mysql.c:682: 错误:‘_mysql_ConnectionObject’没有名为‘converter’的成员
_mysql.c:682: 错误:‘NULL’未声明(在此函数内第一次使用)
_mysql.c:682: 警告:语句不起作用
_mysql.c: 在文件层:
_mysql.c:689: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:717: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:733: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:751: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:770: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:796: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:818: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:850: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:876: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:903: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:918: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:935: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:951: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:969: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1004: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1035: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1037: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1067: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1097: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1163: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1223: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1248: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1273: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1312: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1351: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1356: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:1359: 错误:expected declaration specifiers or ‘...’ before ‘_PYFUNC’
_mysql.c: 在函数‘_mysql__fetch_row’中:
_mysql.c:1365: 错误:‘PyObject’未声明(在此函数内第一次使用)
_mysql.c:1365: 错误:‘v’未声明(在此函数内第一次使用)
_mysql.c:1365: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:1365: 警告:语句不起作用
_mysql.c:1366: 错误:‘_mysql_ResultObject’没有名为‘use’的成员
_mysql.c:1367: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c:1367: 警告:传递‘mysql_fetch_row’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:552: 附注:需要类型‘struct MYSQL_RES *’,但实参的类型为‘char **’
_mysql.c:1369: 错误:‘Py_BEGIN_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:1369: 警告:语句不起作用
_mysql.c:1370: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c:1370: 警告:传递‘mysql_fetch_row’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:552: 附注:需要类型‘struct MYSQL_RES *’,但实参的类型为‘char **’
_mysql.c:1371: 错误:‘Py_END_ALLOW_THREADS’未声明(在此函数内第一次使用)
_mysql.c:1371: 警告:语句不起作用
_mysql.c:1373: 错误:‘_mysql_ResultObject’没有名为‘conn’的成员
_mysql.c:1373: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:1373: 警告:传递‘mysql_errno’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:428: 附注:需要类型‘struct MYSQL *’,但实参的类型为‘char * (*)[1]’
_mysql.c:1374: 错误:‘_mysql_ResultObject’没有名为‘conn’的成员
_mysql.c:1378: 警告:隐式声明函数‘_PyTuple_Resize’
_mysql.c:1378: 错误:‘r’未声明(在此函数内第一次使用)
_mysql.c:1381: 警告:隐式声明函数‘convert_row’
_mysql.c:1381: 警告:语句不起作用
_mysql.c: 在文件层:
_mysql.c:1399: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1478: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1506: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1528: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1568: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1597: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1612: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1627: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1642: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1658: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1693: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1711: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1734: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1751: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1767: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1796: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1819: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1849: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1871: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1898: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1919: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1960: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1980: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: 在函数‘_mysql_ConnectionObject_dealloc’中:
_mysql.c:2014: 错误:‘PyObject’未声明(在此函数内第一次使用)
_mysql.c:2014: 错误:‘o’未声明(在此函数内第一次使用)
_mysql.c:2014: 错误:双目运算符 * 操作数(‘char **’和‘char **’)无效
_mysql.c:2014: 警告:语句不起作用
_mysql.c:2017: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
_mysql.c:2018: 警告:隐式声明函数‘_mysql_ConnectionObject_close’
_mysql.c:2018: 错误:‘NULL’未声明(在此函数内第一次使用)
_mysql.c:2018: 警告:语句不起作用
_mysql.c:2021: 警告:隐式声明函数‘PyMem_Free’
_mysql.c: 在文件层:
_mysql.c:2024: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2041: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2056: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2078: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: 在函数‘_mysql_ResultObject_dealloc’中:
_mysql.c:2100: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c:2100: 警告:传递‘mysql_free_result’的第 1 个参数时在不兼容的指针类型间转换
/usr/include/mysql/mysql.h:545: 附注:需要类型‘struct MYSQL_RES *’,但实参的类型为‘char **’
_mysql.c: 在文件层:
_mysql.c:2105: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2115: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_methods’
_mysql.c:2330: 错误:数组元素的类型不完全
_mysql.c:2331: 错误:‘T_INT’未声明(不在函数内)
_mysql.c:2331: 警告:隐式声明函数‘offsetof’
_mysql.c:2331: 错误:expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2331: 错误:‘RO’未声明(不在函数内)
_mysql.c:2338: 错误:‘T_OBJECT’未声明(不在函数内)
_mysql.c:2338: 错误:expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2345: 错误:‘T_UINT’未声明(不在函数内)
_mysql.c:2345: 错误:expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2352: 错误:expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2359: 错误:expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2366: 错误:‘NULL’未声明(不在函数内)
_mysql.c:2369: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_methods’
_mysql.c:2421: 错误:数组元素的类型不完全
_mysql.c:2422: 错误:expected expression before ‘_mysql_ResultObject’
_mysql.c:2432: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2460: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2490: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: 在函数‘_mysql_ConnectionObject_setattr’中:
_mysql.c:2492: 错误:‘v’未声明(在此函数内第一次使用)
_mysql.c:2493: 警告:隐式声明函数‘PyErr_SetString’
_mysql.c:2493: 错误:‘PyExc_AttributeError’未声明(在此函数内第一次使用)
_mysql.c:2498: 警告:隐式声明函数‘PyMember_Set’
_mysql.c: 在文件层:
_mysql.c:2515: 错误:expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: 在函数‘_mysql_ResultObject_setattr’中:
_mysql.c:2517: 错误:‘v’未声明(在此函数内第一次使用)
_mysql.c:2518: 错误:‘PyExc_AttributeError’未声明(在此函数内第一次使用)
_mysql.c: 在文件层:
_mysql.c:2536: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2620: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2706: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:2778: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2810: 警告:返回类型默认为‘int’
_mysql.c: 在函数‘DL_EXPORT’中:
_mysql.c:2810: 错误:expected declaration specifiers before ‘init_mysql’
_mysql.c:2888: 错误:expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1

上一篇:【代码笔记】Web-HTML-基础


下一篇:在Windows 7下面IIS7的安装和 配置ASP的正确方法