본문 바로가기

MySQL

MySQL Python 연동

1. mysqldb 다운

wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz


2. 최초 setuptools가 필요합니다.

     setuptools 설치 검색하면 나옴

3. site.cfg 수정이 필요합니다.
   저는 여기서 삽질했습니다. mysql을 static하게 컴파일을 했었더니 라이브러를 못찾는 경우가 발생합니다. 원인을 찾아볼려고 했지만 LD_LIBRARY_PATH 혹은 /etc/ld.so.conf 를 수정해도 원인 불명이였습니다.


 [options]
# embedded: link against the embedded server library
# threadsafe: use the threadsafe client
# static: link against a static library (probably required for embedded)
embedded = False #이거 뭘까요? 서버 라이브러리 링크? 링크되어진경우인가?
threadsafe = True #mysql 컴파일시 --enable-thread-safe-client 포함되어져 있을경우 입니다.
static = False #동적 라이브러리로 컴파일할경우에는 False입니다