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

CentOS 5.6 + NginX 0.8.54 + Django 1.3 (FastCGI) + Pyt...

gcc Library 경로 지정

Linux Command 로 Mysql table drop 방법

CentOS 자동로그인 설정

CentOS Linux Remote Desktop 에서 로그인 화면보기

SCM - 캐시 서버 구축 (Squid in Linux)

SSL 패스워드 삭제 하기

vi 이미 읽은 파일의 인코딩 변경하기 ( euc-kr 로 encodi...

How to Enable EPEL Repository for RHEL/CentOS 6/5

[Linux] Proxy 서버 설정하기

Zabbix 웹서비스 모니터링

Hamlet 은 “웹서버 모니터링 오픈소스 솔루션” 입니다.

cacti plugin thold 설치

원격데스크톱(RDP) 클라이언트 접속기록(Log) 삭제하기 file

[우분투] 노하드 서버 설정하기

Dell OMSA 설치 및 이용방법

[CentOS] sshfs - 리눅스 윈도우간 데이터 전송을 편리하게 file

Install 3ware (LSI) 9690SA SCSI RAID Controller VIB On... file

[맥] 커맨드 라인에서 CD/DVD 꺼내기

[linux][명령어 백그라운드 실행]

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234