MySQLdb-1.0 won't build with MySQL-4.1
MySQL database connector for Python programming
Brought to you by:
adustman
When I build the module for Python for MySQL, I get the
following error:
running build_ext
building '_mysql' extension
gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686
-D_GNU_SOURCE -fPIC -fPIC -I/usr/include/mysql
-I/usr/local/include/mysql -I/usr/local/mysql/include
-I/usr/local/mysql/include/mysql
-I/usr/include/python2.2 -c _mysql.c -o
build/temp.linux-i686-2.2/_mysql.o
_mysql.c: In function _mysql_ConnectionObject_shutdown':
_mysql.c:1545: too few arguments to function
mysql_shutdown'
error: command 'gcc' failed with exit status 1
What do I need to resolve this issue?
rexecampbell@yahoo.com
Logged In: YES
user_id=71372
You are compiling against MySQL-4.1 (you should have said
this in your initial report). There's no support for
MySQL-4.1 in MySQL-python-1.0.x. Use the 1.1.x series.
Additionally you should set this environment variable:
$ export mysqlversion=4.1.7 # or whatever version you have
before you run setup.py. Review README. You might need
Python-2.3 or newer; let me know what happens with Python-2.2.
Logged In: NO
Make line 2480 of _mysql.c look like this:
r = mysql_shutdown(&(self->connection),SHUTDOWN_DEFAULT);
Apparently the mysql guys added the option but failed to give it a default
function if not defined. So much for backwards compatibility.
Hope this helps,
Anthony
aj@NOSPAMbootsector.org
Logged In: YES
user_id=721816
You need to change line #1545 in _mysql.c from
r = mysql_shutdown(&(self->connection));
to
r = mysql_shutdown(&(self->connection),SHUTDOWN_DEFAULT);
I didn't get anymore compiler errors after doing that so I
hope this works for everybody.
Cheers!
Dan
Logged In: YES
user_id=71372
Fixed in 1.1.x series; not supported for 1.0.x.