MySQL module

richard at insight20.freeserve.co.uk richard at insight20.freeserve.co.uk
Sun Jun 11 10:27:11 EDT 2000


dana_booth <dana at oz.net> writes:

> Sam Wun <samwun at yahoo.com> wrote:
> 
> SW: I've tried to use command python build.py to build the module, but it
> SW: complains the _mysqlmodule.so is not found...
> 
> I got ahold of this module, and it compiled just fine. Just make sure that
> in the "Setup" file, the paths to mysql are okay. For instance, on mine, I
> had to change from "/usr/include" and "/usr/lib" to "/usr/local/..."

Yes, I've trodden this path in the last few days!!!

Expanding Dana's advice - the compiler needs to be able to "see" the
MySQL data structures, which is why you have to give a path to
mysql.h, and link to its libraries, hence the path to them also
(that's technically correct, isn't it?)

I ended up with
_mysql _mysqlmodule.c -L/usr/local/mysql-3.22.32-pc-linux-gnu-i686/lib -I/usr/local/mysql-3.22.32-pc-linux-gnu-i686/include -lmysqlclient

in replacement for the original
"_mysql _mysqlmodule.c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient"

Richard Smith



More information about the Python-list mailing list