'FreeBSD'에 해당되는 글 3건

  1. 2008/08/29 DBD::mysql 모듈 설치
  2. 2006/05/15 freebsd 세미나 참가
  3. 2006/04/22 제7회 CodeFest및 프비세미나(Back to the FreeBSD)
perl에서 데이터베이스 접근을 위한 모듈을 설치한다.
사용자는 DBI모듈 불러오고 이 DBI모듈이 DBD::mysql 모듈을 불러와 DB에 접근할 수 있다.

모듈정보를 확인한다.

# perl -MDBI -e 'print "$DBI::VERSION\n"'
Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/mach /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.6/BSDPAN /usr/local/lib/perl5/5.8.6/mach /usr/local/lib/perl5/5.8.6 .).
BEGIN failed--compilation aborted.

# perl -MDBD::mysql -e 'print "$DBD::mysql::VERSION\n"'
Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/mach /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.6/BSDPAN /usr/local/lib/perl5/5.8.6/mach /usr/local/lib/perl5/5.8.6 .).
BEGIN failed--compilation aborted.

# cpan
cpan> i /DBI/
cpan> install DBI
cpan> exit
# perl -MDBI -e 'print "$DBI::VERSION\n"'
1.607

DBI 모듈이 설치되었다.

DBD::mysql 모듈을 설치한다.

# cpan
cpan> install DBD::mysql
...
mysql_config 를 찾지못한다고 오류가나면서 종료된다.
$PATH를 추가하고 다시 한다.

이번에는 DB 테스트하는 과정에서 오류가 난다.
테스트를 건너뛰고 모듈을 설치할 수도 있겠지만 어떻게 하는지는 모르겠다.
기본 DB가 test인데 내가 가지고 있는 mysql 서버에는 test DB조차 없다.
root 계정도 비밀번호가 있어서 어쨌든 DB 테스트는 실패로 끝났다.

$HOME/.cpan/ 디렉토리의 설치문서를 본다.

$ vi /root/.cpan/build/DBD-mysql-4.008/INSTALL.html

이런 부분이 있다.

CPAN installation

.....
If you cannot get the CPAN module working, you might try manual installation. If installation with CPAN fails because the your local settings have been guessed wrong, you need to ensure MySQL's mysql_config is on your path (see SOURCE INSTALLATION) or alternatively create a script called mysql_config. This is described in more details later. Configuration.
....

또 이런 부분도 있다.

Configuration

The install script ``Makefile.PL'' can be configured via a lot of switches. All switches can be used on the command line. For example, the test database:

  perl Makefile.PL --testdb=<db>

If you do not like configuring these switches on the command line, you may alternatively create a script called mysql_config. This is described later on.

Available switches are:

testdb

   Name of the test database, defaults to test.

testuser

   Name of the test user, defaults to empty. If the name is empty, then the currently logged in users name will be used.

testpassword

   Password of the test user, defaults to empty.

testhost

   Host name or IP number of the test database; defaults to localhost.

testport

   Port number of the test database

ps-protcol=1 or 0

   Whether to run the test suite using server prepared statements or driver emulated prepared statemetns. ps-protocol=1 means use server prepare, ps-protocol=0 means driver emulated.

cflags

   This is a list of flags that you want to give to the C compiler. The most important flag is the location of the MySQL header files. For example, on Red Hat Linux the header files are in /usr/include/mysql and you might try

     -I/usr/include/mysql

   On Windows the header files may be in C:\mysql\include and you might try

     -IC:\mysql\include

   The default flags are determined by running

     mysql_config --cflags

   More details on the C compiler flags can be found in the following section. Compiler flags.

libs

   This is a list of flags that you want to give to the linker or loader. The most important flags are the locations and names of additional libraries. For example, on Red Hat Linux your MySQL client libraries are in /usr/lib/mysql and you might try

     -L/usr/lib/mysql -lmysqlclient -lz

   On Windows the libraries may be in C:\mysql\lib and

     -LC:\mysql\lib -lmysqlclient

   might be a good choice. The default flags are determined by running

     mysql_config --libs

   More details on the linker flags can be found in a separate section. Linker flags.

If a switch is not present on the command line, then the script mysql_config will be executed. This script comes as part of the MySQL distribution. For example, to determine the C compiler flags, we are executing

  mysql_config --cflags
  mysql_config --libs

If you want to configure your own settings for database name, database user and so on, then you have to create a script with the same name, that replies

 
=head2 Compiler flags

Note: the folling info about compiler and linker flags, you shouldn't have to use these options because Makefile.PL is pretty good at utilising mysql_config to get the flags that you need for a successful compile.

It is typically not so difficult to determine the appropriate flags for the C compiler. The linker flags, which you find in the next section, are another story.

The determination of the C compiler flags is usually left to a configuration script called mysql_config, which can be invoked with

  mysql_config --cflags

When doing so, it will emit a line with suggested C compiler flags, for example like this:

  -L/usr/include/mysql

The C compiler must find some header files. Header files have the extension .h. MySQL header files are, for example, mysql.h and mysql_version.h. In most cases the header files are not installed by default. For example, on Windows it is an installation option of the MySQL setup program (Custom installation), whether the header files are installed or not. On Red Hat Linux, you need to install an RPM archive mysql-devel or MySQL-devel.

If you know the location of the header files, then you will need to add an option

  -L<header directory>

to the C compiler flags, for example -L/usr/include/mysql.


# cd ~/.cpan/build/DBD-mysql-4.008
# perl Makefile.PL --testdb=xxxx --testuser=xxxx --testpassword=xxxx --testhost=localost
# make
# make test
테스트할때 중간쯤 오래걸릴때가 있다. 그럴땐 가볍게 Ctrl-C..

# make install
# perl -MDBD::mysql -e 'print "$DBD::mysql::VERSION\n"'
4.008

운영체제는 FreeBSD 5.4 이고 perl 버전은 5.8.6, mysql 버전은 4.1.18 이다.
토요일 프비시티(http://freebsdcity.org/) 주최 프비세미나 참가를 위해 한국 소프트웨어 진흥원(http://oss.or.kr)에 갔다.

참가자 명단에 표기하고 책자와 CD를 받았다.

3시간여 정도 듣다가 중간에 나왔다.

아무래도 요새 Gentoo 때문에 신경이 예민한거 같다.

CD를 받은건 그나마 수확이다.

확실히 한국쪽은 BSD계열이 Linux계열보단 덜 활성화 된듯하다.


다음엔 기필코 코드페스트에 참가해야 겠다...
http://kldp.org/node/69322
http://www.freebsdcity.org/?doc=bbs/gnuboard.php&bo_table=announce&wr_id=266

오랫동안의 침묵을 깨고 제 7 회 코드페스트를 열겠습니다. 이번회에는 특별히 FreeBSD City 커뮤니티 식구들과 같은날 같은 장소에서 행사를 하게 되었습니다. 일시는 5월 13일, 14일 양일간이며, 이번 7 회 코드페스트의 행사 기간이 많은 분들께서 모이기 어려우신 시기이기에 서울시 송파구 가락동에 있는 '한국 소프트웨어 진흥원' 에서 하기로 했습니다. 더욱이 이번엔 저희가 충당할 수 있는 것들을 이용하여 최대한 작게 진행해 볼 생각입니다.

행사 참가 신청은 http://wiki.kldp.org/wiki.php/CodeFest/20060513 에서 받겠습니다. 참여해주시는 분들께서는 주변 커뮤니티에도 이 소식을 알려주셔서 많은 분들께서 알고 참여하실 수 있도록 협조해주셨으면 합니다.

제 7 회 코드페스트
일시 : 2006년 5월 13~14일 (토~일, 2일동안 개최)
장소 : 서울 송파구 가락동 한국소프트웨어진흥원

이번 회차의 참가비는 무료로 할 예정입니다. 대신 여러분들께서 몇가지 필요한 물품들을 가져와 주셨으면 합니다. 집에 네트워크 장비(허브)가 있으신 분들, UTP 케이블이 있으신 분들은 지참해주시기 바랍니다. 많은 도움 부탁드립니다.

사용자 삽입 이미지

세번째 프비세미나 ( Back to the FreeBSD )를 준비합니다.
이번 세미나는 특별히 제7차 CodeFest ( http://kldp.org/node/69322 )와 함께 진행하기로 하였습니다.

이름: Back to the FreeBSD

일정: 5월 13일 토요일 오후 2시부터 5시까지 - 5시부터 CodeFest 가 이어집니다
장소: 서울시 송파구 가락동 한국소프트웨어진흥원
   - 찾아오시는길 http://www.software.or.kr/kipahome/kipaweb/intro/map/index.html

대상: 프비를 사랑하는 모든 생명체, (꼭 사람이 아니어도 됨)
참가비: 무료확정 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

후원: 한국소프트웨어진흥원( http://software.or.kr ) 공개소프트웨어지원센터( http://oss.or.kr )
협찬/후원/광고/홍보 대환영 합니다.

주제: 아래와 같으며 사정에 따라 변동될 수 있습니다.

1) ipv6 - 강사확정 : 한종우
2) 버그리포팅 하는 방법, 포트메인테이너가 되는 방법 - 강사확정 : 황병희
3) java(jython) + FreeBSD - 강사확정 : ENg
4) 프비설치하기 - 본체를 가져오시면 도우미가 설치를 도와드립니다. 도우미확정 : 익현,티니,
                       본체가지고 오실분은 참가예약하실때 ''본체지참''이라고 적어주세요

* 강의교재와 FreeBSD 6.0 CD 배포예정
* 뒤풀이 - 소주한잔 (절대공짜아님: 회비 1만원: 군인/미성년자 5천원: 병특 7천원: 군인애인 2만원) -_-;)=b