달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

SMALLSQL 순수 자바 DBMS다 

http://suite.tistory.com/ fs 2006.12


간단한 데이터를 관리할때 보통 파일을 이용한다.
하지만 데이터 수정/삭제등이 많을때나 데이터를 관리 할려면 뭐니해도
DBMS를 이용하는게 편하다. 그렇다고  mysql 같은걸 설치하기에는 부담이가고
또 이기종간에도 설치등 번거롭다. 그래서 요즘 모두? 하는 자바쪽을 쉽게 이용하라고
순수 자바코딩으로 구성된 SAMLLSQL이 오픈 소스로 이미 나왔다.

사용법이나 다운로드 하는곳은 아래 링크에 있고 여기서는 간단하게 설명만...


smallsql 홈페이지

http://www.smallsql.de/


다운로드

http://sourceforge.net/project/showfiles.php?group_id=135116&package_id=148332




2006.10 버전


설치/사용문서 파일 - smallsql0.16_doc.zip

패키지 파일 - smallsql0.16_lib.zip (smallsql.jar)

소스 파일 - smallsql0.16_src.zip


1. 설치


   - 최신버전의 smallsql.jar를 다운 로드 받는다.
   - 클래스 패스에 추가
     sh ex) export CLASSPATH=.:$ANY_DIR/smallsql.jar

   - 설정한 쉘에서 $>javap smallsql.database.SSDriver 실행 후
     아래와 같은 메시지가 나온다면 정상
     public class smallsql.database.SSDriver extends java.lang.Object implements java.sql.Driver{
      static final java.lang.String URL_PREFIX;
      static smallsql.database.SSDriver drv;
      ....
      ..

   - 드라이버 설정
     Class.forName( "smallsql.database.SSDriver" );


   - 디비 연결 설정 (타 dbms와 달리 계정부분이 필요없다.)
     java.sql.Connection con = java.sql.DriverManager.getConnection( "jdbc:smallsql:db1" );
   
     db1은 데이터베이스이다. 실행한 디렉토리에 db1이란 디렉토리를 확인할 수 있다.
     만약 디렉토리가 없다면 자동으로 새로 만들수 있는 옵션 "create=true" 을 준다
     ex) con = java.sql.DriverManager.getConnection( "jdbc:smallsql:db1?create=true" );
   


2. 사용


   일반 JDBC  사용법과 같다.


   Statement stmt  = con.createStatement();

   테이블 생성

   ex)  String sql_t="CREATE TABLE jang_test( kwd_test char(100), cnt int)";
         stmt.executeUpdate(sql_t);  

  데이터 삽입

         String sql_i="insert into jang_test(kwd_test,cnt) values('jang102',102)";
         stmt.executeUpdate(sql_i);  


  데이터 읽어오기

         String sql_s="select * from  jang_test;
         stmt.executeQuery(sql_s);  


보다 자세한 사항은 smallsql 홈페이지의 doc 파일을 참조하면 데이터 지원 타입등을
확인 할수 있다.


3. 단점

   - 네트웍 지원이 안돼 로컬에서만 가능

   - 같은시간에 여러 실행한 어플리케이션간 공유가 안됌

   - 공짜니 지원 없음



 

:
Posted by mastar

http://suite.tistory.com/

fs 2008 03

아파치 대표적인 로그인 access_log , error_log 를  관리하는게 여러가지가 있는데 내장된 logrotate 와 같은경우

사용한지 오래되서 기억이 잘안나지만 뭔가 월 날짜 별로 하는게 어려웠던것 같다 그래서 대체용으로 cronolog 를 사용한다.


먼저 설치


1. http://www.cronolog.org/


  $>wget http://cronolog.org/download/cronolog-1.6.2.tar.gz 최신이 2002년~~


2. 컴파일

    $>./configure --prefix=/MPA/apache2/cronolog

    $> make;make install

3. 아파치 http.conf 수정

   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

   #CustomLog logs/access_log common <- 기존 로그 생성 주석 처리

   # 접근로그는 날짜별로  

   CustomLog  "|/MPA/apache2/cronolog/sbin/cronolog  /MPA/apache2/logs/%Y%m%d.access.log" combined  


  #ErrorLog logs/error_log <- 기존 로그 생성 주석 처리

  # 에러로그는 월별로

  ErrorLog "|/MPA/apache2/cronolog/sbin/cronolog /MPA/apache2/logs/%Y%m.errors.log"


4. 아파치 재시작

  $> ls MPA/apache2/logs 확인


 

 

:
Posted by mastar


APACHE + FCGI 연동 , 예제   ( apache2 - fast cgi - 2006 06)

http://suite.tistory.com/ fs


0. 준비
 - 소스 다운로드
  apache : http://www.apache.org
  fcgi   : http://www.fastcgi.com

  사이트에서 검색? 하여 소스를 다운 받는다.
 
  httpd-2.0.54.tar.gz , mod_fastcgi-2.4.2.tar.tar,fcgi-2.4.0.tar
  참고로 httpd-2.2.2 버전은 fcgi 모듈 설치시 헤더파일 없다는 문제 발생
  되도록 httpd-2.0XX 버전을 다운 받는다. (httpd-2.1XX 테스트 안해봄)

 - 설치 계정: 설치 계정 생성
     ex) $>useradd fs
        - 설치 디렉토리 : /home/fs/apmz
     ex) fs$> mkdir apmz

 * 데비안 리눅스 3.0 에서 설치 한 문서

1. apache 설치


      가. 해당 소스를 압축을 푼 디렉토리에서 configure 수행
      
        ./configure --prefix=/home/fs/apmz/apache2 --enable-mods-shared=most --enable-modules=so --with-mpm=worker
 
       옵션 설명: 
      --prefix= 설치 디렉토리 디렉토리
      --enable-mods-shared=most --enable-modules=so  DSO 방식으로 PHP 모듈을 끼워 넣을 수 있도록 아파치를 컴파일하기 위해 옵션을 반드시 사용합니다.
     --with-mpm=worker 옵션은 아파치 설정 파일에서 살펴보겠지만 다중 프로세서 모듈(MPM) 중 worker 모듈을 지원할 수 있도록 하는 옵션입니다.
          이 옵션을 추가하지 않으면 아파치 2.x 버전에서는 기본적으로 perfork 모듈을 지원합니다.
        
     *오류 발생시 리플
       http://cafe.naver.com/linuxmaster.cafe 


      나.  컴파일
          ./make
         *오류 발생시 리플
             http://cafe.naver.com/linuxmaster.cafe 


      다. 설치
    ./make install
    ls /home/fs/apmz/apache2 실행하여 설치되었는지 확인해본다.


       라. LD_LIBRARY_PATH 설정
          아파치가 SO 모듈을 찾을수 있도록 사용자 쉘에 모듈 디렉토리 위치를 설정해둔다.
           mysql 디렉토리 뒤에 apache2/lib , apache2/modules 두개 추가 해준다
          ex) bash 쉘경우
          vi 홈디렉토리/.bash_profile
         export LD_LIBRARY_PATH=/home/fs/apmz/apache2/lib:/home/fs/apmz/apache2/modules
         source  .bash_profile 를 실행하여 바로 현 쉘에 적용


      바. 실행
   
         /home/fs/apmz/apache2/bin/apachectl start
        실행 후 에러가 없으면 완료
         이미 사용하는 포트라는 메시가 나올경우 http.conf 파일에서 수정 할 것


2.  FCGI 모듈 설치
       
    가. fcgi 모듈  


     mod_fastcgi-2.4.2.tar 압축 푼 디렉 토리에서
     Makefile.AP2  파일에서 top_dir=/home/fs/apmz/apache2/fcgi2 을 설치된 fcgi 경로 지정 
     cp  Makefile.AP2 Makefile
     make 
     make install
     설치후 httpd.conf 에 아래 사항을 추가한다 .
       ================================================================================================
      # 아래 모듈 추가 라인이 없다면 httpd.conf에 써준다  
     LoadModule fastcgi_module modules/mod_fastcgi.so
     <IfModule mod_fastcgi.c>
         Alias /fcgi-bin/ "/home/fs/apmz/apache2/fcgi-bin/"
        <Directory "/home/fs/apmz/apache2/fcgi-bin">
            SetHandler fastcgi-script
             Options +ExecCGI
         </Directory>
          # 확장자가 fcgi경우 fast-cgi 동작
       AddHandler fastcgi-script .fcgi .fpl
         
       # 아래 주석으로 해둔 사항은 선택 사항임
       # fast-cgi 프로세스 최대 생성 갯수 값등 설정 (ps -ef 확인)
       FastCgiConfig -initial-env PATH=/home/fs/apmz/apache2/fcgi-bin -maxClassProcesses 3 -startDelay 1
       # 아파치 시작시 이미 fcgi 프로세스를 실행해 둘 경우 설정 (ps -ef 확인)
       # FastCgiServer fcgi-bin/fcgi_example.fcgi -processes 3
       # 보다 자세한 설정사항은 http://www.fastcgi.com   -.-^
    </IfModule>
   ====================================================================================================
 
    나. fcgi C 개발 킷(라이브러리) 설치


      fcgi-2.4.0.tar 압축 푼디렉토리 
     ./configure --prefix=/home/fs/apmz/apache2/fcgi2
      make
      make install
   
3. C 예제 printf("FCGI_Accept()");
  
   fast-cgi 동작원리를 설명하기에는 필자 역시 명확하게는 모르기 때문에 -.-;;
   간단하게 설명하면  일반 CGI 경우 한번 실행할때 마다 프로세스를 생성하여 동작을 해주는데
   fcgi 경우 실행하고 끝나는게 아니고 무한 루프를 돌며 서버형태로 지속적으로 동작 해준다.
   fcgi와 아파치 사이의 프로세스 통신은 UDS(unix domain socket) 기반으로 UDS은 TCP/IP 어플리케이션 계층에서
   TCP 계층까지만 메시지가 전달되고, 다시 곧바로 어플리케이션 계층으로 메시지가 올라가게 된다.
   아무튼 우리가 FCGI를 사용한다면 FCGI_Accept()  API안에다만 적어주면 알아서? 동작하게된다.

   가. 소스
 
   /**********************
     fcgi_example.c 
   ************************/
  
   #include <stdio.h>
   #include "/home/fs/apmz/apache2/fcgi2/include/fcgi_stdio.h"
   int main()
   {

        int cnt=0;
      
        /* fastcgi 시작 부분 이 안에 루프 돌면서 할 작업을 넣어 둔다. **/
        while (FCGI_Accept() >= 0) {

                printf("Content-type: text/html; charset=euc-kr\n\n");
                printf(" Process FCGI_Accept() Cnt:%d",cnt++);
             
        }

        return 0;
    }


    나.  컴파일(정적) libfcgi.a 위치가 /home/fs/apmz/apache2/fcgi2/lib경우 
  
    gcc -o fcgi_example.fcgi fcgi_example.c /home/fs/apmz/apache2/fcgi2/lib/libfcgi.a
  
    fcgi-bin 디렉토리로 복사
    cp fcgi_example.fcgi /home/fs/apmz/apache2/fcgi-bin/


    다.  확인
    아파치 재시작
    /home/fs/apmz/apache2/bin/apachectl  restart
    http://localhost:8244/fcgi-bin/fcgi_example.fcgi
     
   Process FCGI_Accept() Cnt:0
   Process FCGI_Accept() Cnt:1
   Process FCGI_Accept() Cnt:2
           .
            .
           .
   Process FCGI_Accept() Cnt:20

   이처럼 Cnt가 초기화가 되는게 아니라 올라가는걸 볼수있다


   여러 파일을 열어서 자주 사용하는 cgi 프로그램있다면    FCGI_Accept()  함수 위에

   미리 사용할 파일을 미리 열어둔다면 한번만 실행되기 때문에   관련된 소비시간을 많이 줄여

   실용적인 fcgi를 사용할 수 있을것이다.

   
네이버 리눅스 마스터  카페


*  추가 설정 참조

FastCgiConfig -maxProcesses 20 -minProcesses 8 -maxClassProcesses 8 -killInterval 36000 -updateInterval 36000 -idle-timeout 15000 -appConnTimeout 15000 -listen-queue-depth 500 -singleThreshhold 1

AppClass /home/fs/fcgi-bin/fs.fcgi -processes 4 -listen-queue-depth 50 -idle-timeout 3600 -appConnTimeout 2000 -initial-env LD_LIBRARY_PATH=/home/fs/flib

 

:
Posted by mastar

APM (FCGI) + 소스 DSO 모드 설치 - 연동  ( apache2 - fast cgi -  mysql5 php5  - 2006 06)

네이버 리눅스 마스터

http://suite.tistory.com/ fs


0. 준비
 - 소스 다운로드
  apache : http://www.apache.org
  php    : http://www.php.net
  mysql  : http://www.mysql.com

  사이트에서 검색? 하여 소스를 다운 받는다.
 
  mysql-5.0.22 , httpd-2.0.54.tar.gz , php-5.1.4
 
 - 설치 계정: 설치 계정 생성
     ex) $>useradd fs
        - 설치 디렉토리 : /home/fs/apmz
     ex) fs$> mkdir apmz

 * 데비안 리눅스 3.0 에서 설치 한 문서
 * 이미 설치된 apache ,mysql,php 를 지울 필요 없음
 * 아래 글은 조금은 apm를 설치나 문서를 봤으면 금방 설치
   안했으면 좀 삽질 필요함 -.-;
       
1. mysql 설치

    가. 해당 소스를 압축을 푼 디렉토리에서 configure 수행
      
        ./configure --prefix=/home/fs/apmz/mysql5 --localstatedir=/home/fs/apmz/mysql5/datadb --with-mysqld-user=fs --with-charset=euckr --with-tcp-port=4129 --with-unix-socket-path=/home/fs/apmz/mysql5/fs.sock --mandir=/home/fs/apmz/mysql5/man --sysconfdir=/home/fs/apmz/mysql5/datadb --enable-local-infile


       옵션 설명: 
         --prefix= 설치 디렉토리
         --localstatedir= 디비 데이터 디렉토리
         --with-mysqld-user=  디비 사용 계정
         --with-charset= 문자셋 (4.0 이하버전의 경우 euc_kr)
         --with-tcp-port= 사용 포트 (루트로 기본 설치시 3306인데 이미 3306을 쓰지 못하면 임의로 정해준다)
         --with-unix-socket-path= 소켓 파일 (루트로 기본 설치시 /tmp 에 생성되는데  임의로 정해준다)
         --sysconfdir= my.cnf 디렉토리
         --mandir= 매뉴얼 디렉토리

       --enable-local-infile LOAD DATA INFILE 하기위해

         --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static 정적으로 컴파일 할 경우 추가(필수 아님)


      
       나.  컴파일
           ./make

       다. 설치
           ./make install
           ls /home/fs/apmz/mysql5 실행하여 설치되었는지 확인해본다.

      라. MySQL 데이터베이스 생성
         bin 디렉토리로 이동하여 mysql_install_db 명령을 실행합니다(꼭 한번만 실행할 것)
          mysql_install_db 명령은 /home/fs/apmz/datadb 디렉토리를 생성하고, 그 디렉토리 안에 mysql DB 디렉토리와 파일들을 생성해 줌.

        ex) /home/fs/apmz/mysql5/bin/mysql_install_db

           아래와 같은 메시지가 나오면 정상으로 봄
 ================================================================================
 fs@searchasp:~/apmz/mysql5/bin$ /home/fs/apmz/mysql5/bin/mysql_install_db
 ~~~ ~~ ~~ ~~~
 ~~ ~~
 The latest information about MySQL is available on the web at
 http://www.mysql.com
 Support MySQL by buying support/licenses at http://shop.mysql.com
 =================================================================================
      
       마. LD_LIBRARY_PATH 설정
          mysql데몬이 mysql 동적 라이브러리 모듈(so)을 찾을수 있도록 사용자 쉘에 모듈 디렉토리 위치를 설정해둔다.
             ex) bash 쉘경우
             vi 홈디렉토리/.bash_profile
            export LD_LIBRARY_PATH=/home/fs/apmz/mysql5/lib/mysql:
          source  .bash_profile 를 실행하여 바로 현 쉘에 적용
 
       바. 데몬 실행파일 / 설정 파일을 복사
     
       -  /home/fs/apmz/mysql5/share/mysql/mysql.server ==> /home/fs/apmz/mysql5/bin/server 복사
 
       - /home/fs/apmz/mysql5/share/mysql/my-medium.cnf ==> /home/fs/apmz/mysql5/datadb/my.cnf  복사.
        
          참고로 SQL 쿼리 로그를 작성하지않도록 my.cnf에 # log-bin , # server-id 를 주석 처리한다 

       사. mysql 데몬 실행 / 접속
 
              /home/fs/apmz/mysql5/bin/server start 데몬 실행  (stop 정지)
              (server 스크립트 내부적으로 /bin/mysqld_safe &  실행함 )
 
               /home/fs/apmz/mysql5/bin/mysql 실행

                mysql> 콘솔화면이 나오면 설치 완료
 
 

2. apache 설치


         가. 해당 소스를 압축을 푼 디렉토리에서 configure 수행
      
        ./configure --prefix=/home/fs/apmz/apache2 --enable-mods-shared=most --enable-modules=so --with-mpm=worker
 
       옵션 설명: 
               --prefix= 설치 디렉토리 디렉토리
                --enable-mods-shared=most --enable-modules=so  DSO 방식으로 PHP 모듈을 끼워 넣을 수 있도록 아파치를 컴파일하기 위해 옵션을 반드시 사용합니다.
               --with-mpm=worker 옵션은 아파치 설정 파일에서 살펴보겠지만 다중 프로세서 모듈(MPM) 중 worker 모듈을 지원할 수 있도록 하는 옵션입니다.
              이 옵션을 추가하지 않으면 아파치 2.x 버전에서는 기본적으로 perfork 모듈을 지원합니다. 
        
       나.  컴파일
          ./make
     
       다. 설치
            ./make install
            ls /home/fs/apmz/apache2 실행하여 설치되었는지 확인해본다.

       라. LD_LIBRARY_PATH 설정
          아파치가 SO 모듈을 찾을수 있도록 사용자 쉘에 모듈 디렉토리 위치를 설정해둔다.
           mysql 디렉토리 뒤에 apache2/lib , apache2/modules 두개 추가 해준다
            ex) bash 쉘경우
            vi 홈디렉토리/.bash_profile
             export  LD_LIBRARY_PATH=/home/fs/apmz/mysql5/lib/mysql:/home/fs/apmz/apache2/lib:/home/fs/apmz/apache2/modules
  source  .bash_profile 를 실행하여 바로 현 쉘에 적용
      바. 실행
   
         /home/fs/apmz/apache2/bin/apachectl start
          실행 후 에러가 없으면 완료
           이미 사용하는 포트라는 메시가 나올경우 http.conf 파일에서 수정 할 것
    
      사. FCGI 설치
 
         http://www.fastcgi.com 에서 mod_fastcgi-2.4.2.tar , fcgi-2.4.0.tar 받아온다
  
 
          - mod_fastcgi 생성
              mod_fastcgi-2.4.2.tar 압축 푼 디렉 토리에서
             Makefile.AP2  파일에서 top_dir=/home/fs/apmz/apache2로 설치된 아파치 경로 지정 
             cp  Makefile.AP2 Makefile
              make ; make install ( 아파치 2.2.2 버전의경우 헤더파일 없다는 에러 발생함)

             ls /home/fs/apmz/apache2/modules/mod_fastcgi.so 존재 확인후
              httpd.conf 에 모듈 추가 라인 삽입
               "LoadModule fastcgi_module modules/mod_fastcgi.so"

           - fcgi C 개발 킷 설치
              fcgi-2.4.0.tar 압축 푼디렉토리  ./configure --prefix=/home/fs/apmz/apache2/fcgi2;make ;make install
             * FAST CGI 예제는 추후에...


3. PHP 설치

 설치 하기 전 각종 라이브러리 설치 되어 있어야 함
 
 libxml2 - http://xmlsoft.org/ 
 zlib - http://www.gzip.org/zlib/  - 그래픽 지원 (필수 아님 )
 libpng - http://libpng.sourceforge.net/  - 그래픽 지원 (필수 아님 )
 free type - http://www.freetype.org/  - 그래픽 지원 (필수 아님 )
 libjpeg - http://www.ijg.org/  - 그래픽 지원 (필수 아님 )
 gd - http://www.boutell.com/gd/  - 그래픽 지원 (필수 아님 )
 iconv - http://www.gnu.org/software/libiconv/  - ICOV() 지원  (필수 아님 )


 
 라이브러리 설치가 모두 되었다면 
 
       가. php5 해당 소스를 압축을 푼 디렉토리에서 configure 수행   

         풀 옵션 실행시

        ./configure --prefix=/home/fs/apmz/php5 --mandir=/home/fs/apmz/php5/man --with-charset=euc_kr --with-apxs2=/home/fs/apmz/apache2/bin/apxs --with-mysql=/home/fs/apmz/mysql5 --with-config-file-path=/home/fs/apmz/php5/etc --with-exec-dir=/home/fs/apmz/apache2/bin --enable-track-vars  --with-fastcgi  --with-libxml-dir=/home/fs/apmz/libs/libxml --with-gd-dir=/home/fs/apmz/libs/libgd --with-jpeg-dir=/home/fs/apmz/libs/libjpeg --with-zlib-dir=/home/fs/apmz/libs/libzlib --with-iconv=/home/fs/apmz/libs/libiconv


   
       옵션 설명: 
 
          --prefix= 설치 디렉토리 디렉토리
          --with-charset= 문자열 셋
          --with-apxs2=  아파치의 apxs경로 (so 모튤 실행 위해)
          --with-mysql= mysql 위치
          --with-config-file-path= php.ini 환경 파일경로
          --with-exec-dir 아파치 실행 경로
          --enable-track-vars  옵션은 HTTP_GET_VARS, HTTP_POST_VARS, HTTP_COOKIE_VARS 배열에 들어 있는 GET, POST, cookie 변수들이 어디서 왔는지 기억하도록 함 꼭 설정
          --with-libxml-dir  libxml2 설치 경로 지정
          --with-gd --with-jpeg-dir --with-zlib-dir   PHP 자체적으로 그래픽을 지원 위해  필수 아님 
          --with-iconv php에서 iconv()를 사용위해 필수 아님 -  만약 이옵션에서 iconv 라이브러리를 찾지 못 할 경우 따로 설치해야 함 


       * 오류 발생시 리플  
      나.  컴파일 
         ./make
          *  오류 발생시 리플
      다. 설치
          ./make install
          ls /home/fs/apmz/php5 실행하여 설치되었는지 확인해본다.
          모듈(libphp5.so)이 생성되었는지 확인 해 본다.
        ls /home/fs/apmz/apache2/modules/libphp5.so
        
  
      라. 환경 파일 복사
        소스디렉토리에있는 php.ini-dist를 --with-config-file-path= 경로위치에 복사
        /php-5.1.4$ cp php.ini-dist /home/fs/apmz/php5/etc/php.ini
        vi /home/fs/apmz/php5/etc/php.ini 파일을 열어
 
          register_globals = Off --> On 으로 변경한다.
         원래 기본적으로 보안상 Off임 하지만 사용 할 경우가 많다. 그래서 ON

      마. httpd.conf을 열어 
       

         -  LoadModule php5_module   modules/libphp5.so  라인이 존재 하지 않는다면 추가 해준다
 
         -  AddType application/x-httpd-php .php  라인이 존재 하지 않는다면 추가 해준다
             httpd.conf 수정 완료 후
              아파치를 재 시작 해준다 .

  

           마지막으로 <? phpinfo(); ?> php 스크립트를 웹에서 설치가 모두 잘 되었는지 확인해 본다.

 

:
Posted by mastar

http://suite.tistory.com/ fs 2006



mysql_install_db 실행시 아래와 같은 메시지가 나오는데


============================================================================

mkdir: `/var/lib/mysql/mysql' 디렉토리를 만들 수 없습니다: 허가 거부됨
chmod: cannot access `/var/lib/mysql/mysql': 그런 파일이나 디렉토리가 없음
mkdir: `/var/lib/mysql/test' 디렉토리를 만들 수 없습니다: 허가 거부됨
chmod: cannot access `/var/lib/mysql/test': 그런 파일이나 디렉토리가 없음

=========================================================================


레드헷 AS4 경우 이미 rpm으로 설치된 mysql /etc/my.cnf 파일을 참조해서 문제가 발생하는것 같은데

삭제 하지않고 해결 방법은 아래와 같다 .



 - ./mysql_install_db  --no-defaults 실행하여 디비 생성


-  ./mysqld_safe  --defaults-file=/my.cnf 환경파일있는디렉토리/my.cnf & 옵션을 추가 하여 데몬을 실행하거나


    share/mysql/mysql.server 파일을  ./bin/server 파일로 복사하여 데몬을 실행 한다면

    server 파일 220 란인쯤에 #parse_server_arguments 를 주석 처리하여  사용하면된다.

    ./bin/server start | stop






 

 

:
Posted by mastar

http://suite.tistory.com/  fs 2006 9


바이너리로 설치 에러시 처리 방법

1 .아래 에러 경우 초기 디비를 생성

060826 15:00:38  mysqld started
060826 15:00:38 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when t
his MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=kmsdrm01-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!


mysql 홈디렉토리에서 scripts 포함하여 실행


ex)./scripts/mysql_install_db


2. 아래 에러 경우 mysql 설치된 디렉토리 소유권을 safe_mysqld를 실행하는 계정의 소유로 변경한다.


060901 15:28:21  mysqld started
060901 15:28:22 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when t
his MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=kmsdrm01-bin' to avoid this problem.
^G/usr/local/mysql/bin/mysqld: File './kmsdrm01-bin.index' not found (Errcode: 13)
060901 15:28:22 [ERROR] Aborting

060901 15:28:22 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

60901 15:29:03  mysqld started
^G/usr/local/mysql/bin/mysqld: File './kmsdrm01-bin.index' not found (Errcode: 13)
060901 15:29:03 [ERROR] Aborting


 

예를 루트로 /usr/local/mysql 설치 하게되면 소유권은 루트가 되지만 기본 safe_mysqld 실행시에 user=mysql 계정으로 실행되어

mysql 계정이  접근을 하지 못한다.

이를 해결할려면 /usr/local/mysql 디렉토리 소유권(chown)을 mysql에게 주던지 safe_mysqld 를 열어 user=root로 수정한다.




 

:
Posted by mastar

http://suite.tistory.com/   fs 2008 2


 mysql 5점대 버전을 UTF-8로 설치중에 mysql_install_db 실행하면 아래와같은



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


/search/MPA/mysql5/libexec/mysqld: Character set 'euckr' is not a compiled character set and is not specified in the '/home/xt
en/MPA/mysql5/share/mysql/charsets/Index.xml' file
080225 18:18:40 [ERROR] Aborting

080225 18:18:40 [Note] /search/MPA/mysql5/libexec/mysqld: Shutdown complete

Installation of system tables failed!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


같은 메시지 나오면 설치시 ./configure --with-charset=utf8  --with-extra-charsets=complex 추가 해서 해결

 

:
Posted by mastar

http://suite.tistory.com/   fs 2008 03 19


make 하면 나오는에러 내용


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/lib/libdb-4.3.so: could not read symbols: File in wrong format


/usr/lib/libexpat.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


이런류 에러원인은 32비트에서 쓰던 소스를  64비트 가서 컴파일 하면서 나오는 현상인데
해결은 여러가지가 있겠지만 링크 파일을 바꾸는방법이 제일 쉬운것 같다.


ex)

CentOS 4.4 64비트경우

==== .bash_profile =====


64비트용으로 변경후

#/usr/lib> ln -s /usr/lib64/libexpat.so libexpat.so
#/usr/lib> ln -s /usr/lib64/libdb-4.3.so libdb-4.3.so


다시 컴파일

/httpd-2.0.54/>make clean
/httpd-2.0.54/>./configure
/httpd-2.0.54/>make
/httpd-2.0.54/>make install

 

:
Posted by mastar

http://suite.tistory.com/   fs  2008.4



configure에서 --with-mysqld-user= 옵션을 주어도  root 쪽 기본 디렉토리를 바로 볼때


에러 메시지 예

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mkdir: `/var/lib/mysql' 디렉토리를 만들 수 없습니다: 허가 거부됨
chmod: cannot access `/var/lib/mysql': 그런 파일이나 디렉토리가 없음
mkdir: `/var/lib/mysql/mysql' 디렉토리를 만들 수 없습니다: 그런 파일이나 디렉토리가 없음
chmod: cannot access `/var/lib/mysql/mysql': 그런 파일이나 디렉토리가 없음
mkdir: `/var/lib/mysql/test' 디렉토리를 만들 수 없습니다: 그런 파일이나 디렉토리가 없음
chmod: cannot access `/var/lib/mysql/test': 그런 파일이나 디렉토리가 없음
Installing all prepared tables
080410 17:13:00 [Warning] Can't create test file /var/lib/mysql/srch1.lower-test
/search/MPA/mysql5/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
080410 17:13:00 [ERROR] Aborting

080410 17:13:00 [Note] /search/MPA/mysql5/libexec/mysqld: Shutdown complete

Installation of system tables failed!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


=> 설치된 mysql/share/mysql/my-medium.cnf 설정파일을 mysql/bin/my.cnf 에 복사해서 실행시 설정파일을 적용한다


ex1) 최초 디비 생성

     @>mysql/bin/mysql_install_db --defaults-file=my.cnf

ex2) mysql 데몬 기동

     @>mysql/bin/mysqld_safe --defaults-file=my.cnf &


종료할때는 ps -ef |grep mysql해서  kill로 ~~

        


 

:
Posted by mastar