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/d6c/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

linux daemon (리눅스 데몬 설명)

대용량 HDD 파티셔닝(Mass storage Partitioning) (GPT 파...

FFMPEG를 가장쉽게 설치하는 방법(ffmpeg-php 등)

rrdtool 컴파일시 에러 configure: error: Please fix the...

커널 2.6으로 업그레이드!「A to Z」

e2fsck - 파일 시스템 복구 및 검사. - fsck file

Maskrading

  • ADMIN
  • 2008-11-11
  • 조회 수 60302

시스템 백업과 응급 복구

배치파일을 이용한 백업방법

  • l2zeo
  • 2010-03-31
  • 조회 수 59635

리눅스 전원부터 부팅이 되기까지의 과정이해

  • ADMIN
  • 2008-11-11
  • 조회 수 59139

리눅스 디렉토리 구조와 파티션 관리의 기본

hdparm 세부옵션

CentOS 설치 - VMware 상에서 CentOS 설치하기 file

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

Red Hat Linux 9

Dell OMSA 설치 및 이용방법

2TB이상의 Disk를 사용한 Raid6 구성

sulinux 1.0. 서버 패키지 리스트

ORA-01031: insufficient privileges 오류

[APM] 리눅스에서 Apache, PHP, MySQL 등 제거 방법

AIX 필수 명령어

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234