Python + Mysql-python 설치 질문입니다.

kihoori의 이미지

환경은 RedHat 7.3 이구여

APM을 DSO방식으로 설치를 하고 나서

Python-2.3.3.tgz
를 받아서 에러 없이 설치 하였습니다

그리고 cjkcodecs-1.0.3.tar.gz

또한 아무런 에러 없이 설치 하게 되었습니다..

그런데 MySQL-python-0.9.2.tar.gz 를 설치 하는데 다음과 같은 에러와 워닝이 납니다

인용:

# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.3
copying CompatMysqldb.py -> build/lib.linux-i686-2.3
copying _mysql_exceptions.py -> build/lib.linux-i686-2.3
creating build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/sets.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.3/MySQLdb
creating build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/mysql/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.linux-i686-2.3/_mysql.o
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -pthread -shared build/temp.linux-i686-2.3/_mysql.o -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -o build/lib.linux-i686-2.3/_mysql.so
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

왠지 warning도 마니 나는것이 mysql설치가 잘못된것 같은데요.. 정확히 어떤점이 잘못되었는지 알수가 없네요 많은 분들의 도움바랍니다.. :oops:

ps. 파이썬 모임에 가서 설치 문서를 여러개 보았지만 모두 예전문서인듯 했습니다.
설정화일 생김새도 조금씩 틀리고 한데 저의 환경에 맞는 설치 문서의 링크도 같이 주셨으면 감사하겠습니다.. :D

feanor의 이미지

MySQL을 설치할 때 --enable-thread-safe-client

MySQL을 설치할 때 --enable-thread-safe-client 옵션을 주지 않으면 libmysqlclient_r 라이브러리가 생성되지 않습니다. mysql-python은 libmysqlclient_r 라이브러리를 필요로 합니다.

--feanor

kihoori의 이미지

우선 답변 주셔서 감사합니다.. 가르쳐 주신데로 mysql을 다시

우선 답변 주셔서 감사합니다..

가르쳐 주신데로 mysql을 다시 인스톨하였습니다..

하였더니 어찌어찌 해서 에러나며 아예 안되던것은 해결하였습니다

하지만 어떻게 된일인지

_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type

이 warning들은 안없어지네요.. 그때문인지 여전히 mysql에는 연결이 안되네요..

이건 gcc의 문제일것 같은데 하.. 참 난감하고 그러네요..ㅜ.ㅜ

인용:
# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)

frenzy의 이미지

thread_safe_library 부분이 yes 되어 있으면, NO 또

thread_safe_library 부분이 yes 되어 있으면, NO 또는 0 으로 변경한후에 다시 설치해 보세요.

kihoori의 이미지

헛.. 그렇게 고치니 되는군여... ;;;import는 되는데

헛.. 그렇게 고치니 되는군여... ;;;

import는 되는데

warning은 계속 나오는것이.. 아무레도 개발자의 오류인거 같은데.. 어찌 만져야 할지 모르겠네요..;;

댓글 보기 옵션

원하시는 댓글 전시 방법을 선택한 다음 "설정 저장"을 누르셔서 적용하십시오.