Skip to content

python 및 MySQLdb를 소스 컴파일 후 아래와 같은 에러가 날 경우에

[user@server ~]$ python
Python 2.6.2 (r262:71600, Jul 15 2009, 16:16:00)
[GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
  File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 19, in <module>
  File "build/bdist.linux-i686/egg/_mysql.py", line 7, in <module>
  File "build/bdist.linux-i686/egg/_mysql.py", line 6, in __bootstrap__
ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory


/etc/profile에서 환경변수 변경

[root@server ~]$ vi /etc/profile
[root@server ~]$ vi /etc/profile
LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql/
export LD_LIBRARY_PATH
[root@server ~]$ source /etc/profile


혹. cron을 이용해서 프로그램을 실행할 경우에는 위와 같이 하더라도 오류가 발생한다.
그럴 경우엔.. crontab 내용 상단에 LD_LIBRARY_PATH를 설정하면 된다..


아래의 굵은 글자는 mysql 경로에 따라 달라질 수 잇음.
[user@server ~]$ crontab -e
[user@server ~]$ crontab -e
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/mysql/lib/mysql/
...
0 * * * * python /home/user/test.py

crontab restart.
profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/277901/15d/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

mrtg를 이용한 시스템자원 모니터링

tomcat log 쌓이는 것 방지하기

하드디스크 정보보기 smartctl

ffmpeg 설치 및 활용

우분투 서버 방화벽. 외부에서 ssh 접속이 안되었다.(Ubun...

  • l2zeo
  • 2010-02-20
  • 조회 수 34890

mount -o remount,rw /

3Ware Controller Problem Determination Procedures (레...

[Ubuntu] 부팅시 시작되는 데몬 관리하기 – update-rc.d

리눅스 IO 스케쥴러 변경하기

HTTP Live Streaming 구축

시스칼리지- 꿔니님의 클러스트링 강좌

  • l2zeo
  • 2010-03-08
  • 조회 수 32760

리눅스 서버 부하 점검 - htop 소스설치 file [3]

가상화 (XEN & KVM) 리눅스 - CentOS 5.4 에서 XEN 설치 file

Cent OS-5.2 설치 문서 file

  • l2zeo
  • 2010-02-24
  • 조회 수 31794

FFMpeg + rtspdump + segmenter 를 이용한 iPhone 스트리...

Apache 설치(Ubuntu Server DIY )

  • l2zeo
  • 2010-02-20
  • 조회 수 31090

Dstat - 모니터링 file

ruby on rails 설치 (Ubuntu Server DIY )

  • l2zeo
  • 2010-02-20
  • 조회 수 30429

CentOS 5.3에서 samba구축방법 file

  • l2zeo
  • 2010-03-08
  • 조회 수 29451

[Linux_CentOS_5.5] 텍스트 모드(Text mode)에서 해상도 변경 file

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234