Using MySQLdb Newbie

Jordan Elver jord at theinternetone.co.uk
Wed Sep 19 15:00:28 EDT 2001


Hi,
I have now installed python-devel and now the install goes further. Now I get 
the foloowing error. i think this is because it can't find the mysql 
libraries etc. 

I have installed mysql in /usr/loca/mysql, so I think the files it's looking 
for should be in /usr/loca/mysql/includes and /usr/loca/mysql/lib, is that 
right?

Any more ideas?

The error message:

building '_mysql' extension
gcc -O3 -fomit-frame-pointer -pipe -mcpu=pentiumpro -march=i586 -ffast-math 
-fno-strength-reduce -fPIC -I/usr/loca/mysql/include -I/usr/include/python2.1 
-c _mysql.c -o build/temp.linux-i686-2.1/_mysql.o
_mysql.c:41:19: mysql.h: No such file or directory
_mysql.c:42:26: mysqld_error.h: No such file or directory
_mysql.c:43:20: errmsg.h: No such file or directory
_mysql.c:59: parse error before `MYSQL'
_mysql.c:59: warning: no semicolon at end of struct or union
_mysql.c:62: parse error before `}'
_mysql.c:62: warning: data definition has no type or storage class
_mysql.c:73: parse error before `MYSQL_RES'
_mysql.c:73: warning: no semicolon at end of struct or union
_mysql.c:77: parse error before `}'
_mysql.c:77: warning: data definition has no type or storage class
_mysql.c:82: parse error before `*'
_mysql.c: In function `_mysql_Exception':
_mysql.c:88: `c' undeclared (first use in this function)
_mysql.c:88: (Each undeclared identifier is reported only once
_mysql.c:88: for each function it appears in.)
_mysql.c:99: `CR_MAX_ERROR' undeclared (first use in this function)
_mysql.c:107: `CR_COMMANDS_OUT_OF_SYNC' undeclared (first use in this 
function)
_mysql.c:108: `ER_DB_CREATE_EXISTS' undeclared (first use in this function)
_mysql.c:109: `ER_SYNTAX_ERROR' undeclared (first use in this function)
_mysql.c:110: `ER_PARSE_ERROR' undeclared (first use in this function)
_mysql.c:111: `ER_NO_SUCH_TABLE' undeclared (first use in this function)
_mysql.c:112: `ER_WRONG_DB_NAME' undeclared (first use in this function)
_mysql.c:113: `ER_WRONG_TABLE_NAME' undeclared (first use in this function)
_mysql.c:114: `ER_FIELD_SPECIFIED_TWICE' undeclared (first use in this 
function)
_mysql.c:115: `ER_INVALID_GROUP_FUNC_USE' undeclared (first use in this 
function)
_mysql.c:116: `ER_UNSUPPORTED_EXTENSION' undeclared (first use in this 
function)
_mysql.c:117: `ER_TABLE_MUST_HAVE_COLUMNS' undeclared (first use in this 
function)
_mysql.c:123: `ER_DUP_ENTRY' undeclared (first use in this function)
_mysql.c:121: warning: unreachable code at beginning of switch statement
_mysql.c:145: warning: passing arg 1 of `PyString_FromString' makes pointer 
from integer without a cast
_mysql.c: At top level:
_mysql.c:152: parse error before `*'
_mysql.c:154: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_New':
_mysql.c:160: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:160: `fields' undeclared (first use in this function)
_mysql.c:161: `r' undeclared (first use in this function)
_mysql.c:163: parse error before `)'
_mysql.c:165: `conn' undeclared (first use in this function)
_mysql.c:167: `result' undeclared (first use in this function)
_mysql.c:176: `conv' undeclared (first use in this function)
_mysql.c: In function `_mysql_connect':
_mysql.c:220: `MYSQL' undeclared (first use in this function)
_mysql.c:220: `conn' undeclared (first use in this function)
_mysql.c:221: parse error before `*'
_mysql.c:237: `c' undeclared (first use in this function)
_mysql.c:237: invalid lvalue in assignment
_mysql.c:239: parse error before `)'
_mysql.c:243: `kwlist' undeclared (first use in this function)
_mysql.c:244: `host' undeclared (first use in this function)
_mysql.c:244: `user' undeclared (first use in this function)
_mysql.c:244: `passwd' undeclared (first use in this function)
_mysql.c:244: `db' undeclared (first use in this function)
_mysql.c:245: `port' undeclared (first use in this function)
_mysql.c:245: `unix_socket' undeclared (first use in this function)
_mysql.c:245: `conv' undeclared (first use in this function)
_mysql.c:246: `connect_timeout' undeclared (first use in this function)
_mysql.c:247: `compress' undeclared (first use in this function)
_mysql.c:247: `named_pipe' undeclared (first use in this function)
_mysql.c:248: `init_command' undeclared (first use in this function)
_mysql.c:248: `read_default_file' undeclared (first use in this function)
_mysql.c:249: `read_default_group' undeclared (first use in this function)
_mysql.c:269: `MYSQL_OPT_CONNECT_TIMEOUT' undeclared (first use in this 
function)
_mysql.c:273: `MYSQL_OPT_COMPRESS' undeclared (first use in this function)
_mysql.c:274: `client_flag' undeclared (first use in this function)
_mysql.c:274: `CLIENT_COMPRESS' undeclared (first use in this function)
_mysql.c:277: `MYSQL_OPT_NAMED_PIPE' undeclared (first use in this function)
_mysql.c:279: `MYSQL_INIT_COMMAND' undeclared (first use in this function)
_mysql.c:281: `MYSQL_READ_DEFAULT_FILE' undeclared (first use in this 
function)
_mysql.c:283: `MYSQL_READ_DEFAULT_GROUP' undeclared (first use in this 
function)
_mysql.c: At top level:
_mysql.c:299: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_close':
_mysql.c:302: `args' undeclared (first use in this function)
_mysql.c:303: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:317: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_affected_rows':
_mysql.c:320: `args' undeclared (first use in this function)
_mysql.c:321: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:345: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_dump_debug_info':
_mysql.c:349: `args' undeclared (first use in this function)
_mysql.c:350: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:361: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_errno':
_mysql.c:364: `args' undeclared (first use in this function)
_mysql.c:365: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:371: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_error':
_mysql.c:374: `args' undeclared (first use in this function)
_mysql.c:375: `self' undeclared (first use in this function)
_mysql.c:376: warning: passing arg 1 of `PyString_FromString' makes pointer 
from integer without a cast
_mysql.c: At top level:
_mysql.c:390: parse error before `*'
_mysql.c: In function `_mysql_escape_string':
_mysql.c:396: `args' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:429: parse error before `*'
_mysql.c: In function `_mysql_string_literal':
_mysql.c:435: `args' undeclared (first use in this function)
_mysql.c: In function `_mysql_escape':
_mysql.c:512: parse error before `)'
_mysql.c: At top level:
_mysql.c:583: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_describe':
_mysql.c:587: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:587: `fields' undeclared (first use in this function)
_mysql.c:588: parse error before `unsigned'
_mysql.c:589: `args' undeclared (first use in this function)
_mysql.c:590: parse error before `)'
_mysql.c:590: parse error before `)'
_mysql.c:591: `n' undeclared (first use in this function)
_mysql.c:591: `self' undeclared (first use in this function)
_mysql.c:594: `i' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:615: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_field_flags':
_mysql.c:619: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:619: `fields' undeclared (first use in this function)
_mysql.c:620: parse error before `unsigned'
_mysql.c:621: `args' undeclared (first use in this function)
_mysql.c:622: parse error before `)'
_mysql.c:622: parse error before `)'
_mysql.c:623: `n' undeclared (first use in this function)
_mysql.c:623: `self' undeclared (first use in this function)
_mysql.c:626: `i' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:664: parse error before `*'
_mysql.c: In function `_mysql_row_to_tuple':
_mysql.c:671: `self' undeclared (first use in this function)
_mysql.c:673: warning: assignment makes pointer from integer without a cast
_mysql.c:677: `row' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:689: parse error before `*'
_mysql.c: In function `_mysql_row_to_dict':
_mysql.c:695: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:695: `fields' undeclared (first use in this function)
_mysql.c:697: `self' undeclared (first use in this function)
_mysql.c:699: warning: assignment makes pointer from integer without a cast
_mysql.c:704: `row' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:728: parse error before `*'
_mysql.c: In function `_mysql_row_to_dict_old':
_mysql.c:734: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:734: `fields' undeclared (first use in this function)
_mysql.c:736: `self' undeclared (first use in this function)
_mysql.c:738: warning: assignment makes pointer from integer without a cast
_mysql.c:743: `row' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:765: parse error before `*'
_mysql.c:769: parse error before `*'
_mysql.c: In function `_mysql__fetch_row':
_mysql.c:776: `MYSQL_ROW' undeclared (first use in this function)
_mysql.c:776: parse error before `row'
_mysql.c:778: `skiprows' undeclared (first use in this function)
_mysql.c:778: `maxrows' undeclared (first use in this function)
_mysql.c:780: `self' undeclared (first use in this function)
_mysql.c:781: `row' undeclared (first use in this function)
_mysql.c:787: parse error before `)'
_mysql.c:788: parse error before `)'
_mysql.c:793: `r' undeclared (first use in this function)
_mysql.c:799: warning: assignment makes pointer from integer without a cast
_mysql.c: At top level:
_mysql.c:810: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_fetch_row':
_mysql.c:814: parse error before `*'
_mysql.c:826: `args' undeclared (first use in this function)
_mysql.c:826: `kwargs' undeclared (first use in this function)
_mysql.c:829: parse error before `)'
_mysql.c:829: parse error before `)'
_mysql.c:837: `self' undeclared (first use in this function)
_mysql.c: In function `_mysql_get_client_info':
_mysql.c:913: warning: passing arg 1 of `PyString_FromString' makes pointer 
from integer without a cast
_mysql.c: At top level:
_mysql.c:918: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_get_host_info':
_mysql.c:921: `args' undeclared (first use in this function)
_mysql.c:922: `self' undeclared (first use in this function)
_mysql.c:923: warning: passing arg 1 of `PyString_FromString' makes pointer 
from integer without a cast
_mysql.c: At top level:
_mysql.c:928: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_get_proto_info':
_mysql.c:931: `args' undeclared (first use in this function)
_mysql.c:932: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:938: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_get_server_info':
_mysql.c:941: `args' undeclared (first use in this function)
_mysql.c:942: `self' undeclared (first use in this function)
_mysql.c:943: warning: passing arg 1 of `PyString_FromString' makes pointer 
from integer without a cast
_mysql.c: At top level:
_mysql.c:948: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:952: `args' undeclared (first use in this function)
_mysql.c:953: `self' undeclared (first use in this function)
_mysql.c:954: warning: assignment makes pointer from integer without a cast
_mysql.c: At top level:
_mysql.c:962: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_insert_id':
_mysql.c:965: `my_ulonglong' undeclared (first use in this function)
_mysql.c:965: parse error before `r'
_mysql.c:966: `args' undeclared (first use in this function)
_mysql.c:967: `self' undeclared (first use in this function)
_mysql.c:969: `r' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:976: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_kill':
_mysql.c:981: `args' undeclared (first use in this function)
_mysql.c:982: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:993: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_field_count':
_mysql.c:996: `args' undeclared (first use in this function)
_mysql.c:997: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1007: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_num_fields':
_mysql.c:1010: `args' undeclared (first use in this function)
_mysql.c:1011: parse error before `)'
_mysql.c:1011: parse error before `)'
_mysql.c:1012: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1017: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_num_rows':
_mysql.c:1020: `args' undeclared (first use in this function)
_mysql.c:1021: parse error before `)'
_mysql.c:1021: parse error before `)'
_mysql.c:1022: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1027: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_ping':
_mysql.c:1031: `args' undeclared (first use in this function)
_mysql.c:1032: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1043: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_query':
_mysql.c:1048: `args' undeclared (first use in this function)
_mysql.c:1049: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1060: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_select_db':
_mysql.c:1065: `args' undeclared (first use in this function)
_mysql.c:1066: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1077: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_shutdown':
_mysql.c:1081: `args' undeclared (first use in this function)
_mysql.c:1082: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1093: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1097: `args' undeclared (first use in this function)
_mysql.c:1098: `self' undeclared (first use in this function)
_mysql.c:1100: warning: assignment makes pointer from integer without a cast
_mysql.c: At top level:
_mysql.c:1108: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_store_result':
_mysql.c:1111: `MYSQL_RES' undeclared (first use in this function)
_mysql.c:1111: `result' undeclared (first use in this function)
_mysql.c:1113: `args' undeclared (first use in this function)
_mysql.c:1114: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1128: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_thread_id':
_mysql.c:1132: `args' undeclared (first use in this function)
_mysql.c:1133: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1142: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_use_result':
_mysql.c:1145: `MYSQL_RES' undeclared (first use in this function)
_mysql.c:1145: `result' undeclared (first use in this function)
_mysql.c:1147: `args' undeclared (first use in this function)
_mysql.c:1148: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1162: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_dealloc':
_mysql.c:1166: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1175: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_repr':
_mysql.c:1178: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1192: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_data_seek':
_mysql.c:1196: `args' undeclared (first use in this function)
_mysql.c:1197: parse error before `)'
_mysql.c:1197: parse error before `)'
_mysql.c:1198: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1207: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_row_seek':
_mysql.c:1211: `MYSQL_ROW_OFFSET' undeclared (first use in this function)
_mysql.c:1211: parse error before `r'
_mysql.c:1212: `args' undeclared (first use in this function)
_mysql.c:1213: parse error before `)'
_mysql.c:1213: parse error before `)'
_mysql.c:1214: `r' undeclared (first use in this function)
_mysql.c:1214: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1224: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_row_tell':
_mysql.c:1227: `MYSQL_ROW_OFFSET' undeclared (first use in this function)
_mysql.c:1227: parse error before `r'
_mysql.c:1228: `args' undeclared (first use in this function)
_mysql.c:1229: parse error before `)'
_mysql.c:1229: parse error before `)'
_mysql.c:1230: `r' undeclared (first use in this function)
_mysql.c:1230: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1236: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_dealloc':
_mysql.c:1238: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1246: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_repr':
_mysql.c:1250: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1290: parse error before `)'
_mysql.c:1290: initializer element is not constant
_mysql.c:1290: (near initialization for 
`_mysql_ConnectionObject_memberlist[2].offset')
_mysql.c:1310: parse error before `)'
_mysql.c:1310: initializer element is not constant
_mysql.c:1310: (near initialization for 
`_mysql_ResultObject_memberlist[0].offset')
_mysql.c:1316: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_getattr':
_mysql.c:1321: `self' undeclared (first use in this function)
_mysql.c:1321: `name' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1338: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_getattr':
_mysql.c:1343: `self' undeclared (first use in this function)
_mysql.c:1343: `name' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1352: parse error before `*'
_mysql.c: In function `_mysql_ConnectionObject_setattr':
_mysql.c:1356: `v' undeclared (first use in this function)
_mysql.c:1361: `c' undeclared (first use in this function)
_mysql.c:1361: `name' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1366: parse error before `*'
_mysql.c: In function `_mysql_ResultObject_setattr':
_mysql.c:1370: `v' undeclared (first use in this function)
_mysql.c:1375: `c' undeclared (first use in this function)
_mysql.c:1375: `name' undeclared (first use in this function)
error: command 'gcc' failed with exit status 1


On Wednesday 19 September 2001 09:44, you wrote:
>     Jordan> distutils.errors.DistutilsPlatformError: invalid Python
> installation: unable Jordan> to open /usr/lib/python2.1/config/Makefile (No
> such file or directory)
>
>     Jordan> Whats going on now?
>
> You're missing a python-devel RPM.  Wherever you got the Python 2.1 RPM
> should also have a python-devel RPM.

-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd




More information about the Python-list mailing list