Trouble with mysql-python 1.2.0 on Solaris 8 sparc

A

Alec Wysoker

I need to be able to access mySQL 4.0 and 4.1 databases from python. I
was hoping to find mysql-python 1.2.0 already built for Sparc, but no
such luck. I've been struggling trying to get it build. First, I had
to hack setup.py because mysql_config --cflags was returning -m64,
which wasn't right because this is on a 32-bit processor. Then I got a
warning:

ld: warning: file /usr/local/mysql/lib/libmysqlclient_r.a(libmysql.o):
wrong ELF class: ELFCLASS64

No idea if this is causing my current problem.

Finally, I seemed to get the thing built and installed, but why I try
to import MySQLdb, I get the following:

File "/usr/local/lib/python2.3/site-packages/MySQLdb/__init__.py",
line 27, in ?
import _mysql
ImportError: ld.so.1: /usr/local/bin/python: fatal: relocation error:
file /usr/local/lib/python2.3/site-packages/_mysql.so: symbol
mysql_errno: referenced symbol not found

Any advice would be greatly appreciated.

Thanks,

Alec Wysoker
 
M

Michael Hoffman

Alec said:
I need to be able to access mySQL 4.0 and 4.1 databases from python. I
was hoping to find mysql-python 1.2.0 already built for Sparc, but no
such luck.

Try version 1.0.1.
 
A

Andy Dustman

Did you build your own MySQL, or did you use a pre-built version? And
what version? It's not clear if you're using 4.0 or 4.1. If
mysql_config is returning the wrong flags, then that's a bug with
MySQL.

You should be able to work around this by doing this in setup.py before
the call to setup():

extra_compile_args.remove('-m64')
 
A

Alec Wysoker

Hi Andy,

Thanks for your message. It turned out that I had installed 64-bit
mySql on a 32-bit machine. I'm amazed it worked at all. Anyway, I
finally got mysql-python built, but I'm unable to connect to a machine
on a remote host. The problem doesn't seem to be with the python code,
because I'm unable to do it even with the mysql command-line client.
Sigh.
 
S

Steve Holden

Alec said:
Hi Andy,

Thanks for your message. It turned out that I had installed 64-bit
mySql on a 32-bit machine. I'm amazed it worked at all. Anyway, I
finally got mysql-python built, but I'm unable to connect to a machine
on a remote host. The problem doesn't seem to be with the python code,
because I'm unable to do it even with the mysql command-line client.
Sigh.
Could be you have a 4.2 server and an earlier client. Unbelievably,
MySQL changed its protocol while only incrementing the minor version
number, and this bit me in the ass when I wanted to move up to 4.1.

regards
Steve
 
S

Steve Holden

Alec said:
Hi Steve,

Thanks for the response. I don't think this is the problem. When I connect to the remote machine, it says this:

Your MySQL connection id is 58 to server version: 4.1.0-alpha-standard

When I connect to the local server, I get this:

Your MySQL connection id is 6 to server version: 4.1.10-standard

One would assume that 4.1.0 and 4.1.10 are compatible, no?
Indeed. Sorry I couldn't be of more assistance. I suspected that the
MySQLdb driver was somehow compiled with 4.0-or-earlier client software
- is this possible?

regards
Steve
 
A

Alec Wysoker

Do you mean the python glue code? I am having this problem when python is not in the picture at all, just running mysql command-line client. Presumably my client is 4.1.10, as it came in a built package along with the 4.1.10 server. In fact, the following seems to indicate that it is the right version:

/usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql Ver 14.7 Distrib 4.1.10, for sun-solaris2.8 (sparc)
 
A

Andy Dustman

What happens when you try to connect? Be sure to check /etc/hosts.allow
and .deny on the server, if your server is compiled with TCP wrapper
support.
 
A

Alec Wysoker

It seems unlikely that is the problem, since I can connect from the
client machine to server using JDBC, just not using mySQL client (any
by extension) mysql-python.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top