I tried to use MySQLDA without success. I have a redhat 6.1 and MySQL 3.22.29 installed. I even installed a unixODBC connection to MySQL that works. How can I access this database through ZOPE. When I try to make the MySQLDA extension a lot of errors come out of it : gcc -fPIC -I/usr/local/mysql-3.22.32/include/ -I/usr/include/mysql -g -O2 -I/us r/include/python1.5 -I/usr/include/python1.5 -DHAVE_CONFIG_H -c ./MySQLmodule.c ./MySQLmodule.c: In function `pythonify_row': ./MySQLmodule.c:238: warning: assignment from incompatible pointer type ./MySQLmodule.c: In function `pythonify_res_fields': ./MySQLmodule.c:384: invalid lvalue in unary `&' ./MySQLmodule.c: In function `STH_fetchdict': ./MySQLmodule.c:1125: invalid lvalue in unary `&' ./MySQLmodule.c:1147: invalid lvalue in unary `&' make: *** [MySQLmodule.o] Error 1 Can you help me ? Does DigitalCreation have a solution on connecting to MySQL on a Linux Platform (thanks to ODBC or something else). Thanks in advance. -- -------------------------------------------------------------------------- Fabrice FRASSAINT (fabrice.frassaint@o-technologies.com) O Technologies 136 Avenue des Champs Elysees PARIS 8ème 01 40 76 24 24
On Thu, Mar 16, 2000 at 11:11:27AM MET
When I try to make the MySQLDA extension a lot of errors come out of it : [...] Can you help me ?
You can help yourself by consulting the archives of this mailing list: The solution is to patch MySQLmodule.c to make it compliant with mysql.h of newer versions of MySQL. You can find my (unofficial) patch in the archives of the mailing list at http://www.egroups.com/group/zope/25783.html Regards, Jo.
Fabrice, I ran into similar errors. Here's the response from Jo Meder that helped me get MySQLDA compiled:
I have tried everything that I can think of (& a lot of what some of you could think of) to get MySQLdb to compile and install. I have had no luck. [...] <OUTPUT OF make> # make
gcc -fpic -g -O2 -I/usr/include/python1.5 -I/usr/include/python1.5 -DHAVE_CO
NFIG_H -I/usr/local/mysql/include -I/usr/include/mysql -c ./MySQLmodule.c ./MySQLmodule.c: In function `pythonify_row': ./MySQLmodule.c:238: warning: assignment from incompatible pointer type ./MySQLmodule.c: In function `pythonify_res_fields': ./MySQLmodule.c:384: invalid lvalue in unary `&' ./MySQLmodule.c: In function `STH_fetchdict': ./MySQLmodule.c:1125: invalid lvalue in unary `&' ./MySQLmodule.c:1147: invalid lvalue in unary `&' make: *** [MySQLmodule.o] Error 1 </OUTPUT OF make>
I suppose line 1125 of mySQLmodule.c is something like: tf = & (mysql_fetch_field_direct(self->res,j)); If this is the case, try applying the following patch to your MySQLmodule.c (this is strictly "works for me"): ------------------cut here----------------------------------------- 235c235 < unsigned int *lengths; ---
unsigned long *lengths;
384c384 < tf = &(mysql_fetch_field_direct(res, i)); ---
tf = (mysql_fetch_field_direct(res, i));
1125c1125 < tf = &(mysql_fetch_field_direct(self->res,j)); ---
tf = (mysql_fetch_field_direct(self->res,j));
1147c1147 < tf = &(mysql_fetch_field_direct(self->res,j)); ---
tf = (mysql_fetch_field_direct(self->res,j));
-----------------cut here------------------------------------------- HTH. Jo.
participants (3)
-
Eric L. Walstad -
Fabrice Frassaint -
Jo Meder