RadarURL

데이터베이스
2011.06.16 23:07

[Fedora 8] Mysql 5.0.67 설치

조회 수 10743 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

mysql-5.0.67 설치

1. mysql 계정/그룹 생성

# useradd -M -s /bin/false mysql
mysql 계정의 홈디렉토리를 만들지 않고 쉘 접속을 허용하지 않도록 생성한다.

2. mysql 설치
다운로드한 mysql-5.0.45.tar.gz 파일을 /usr/local/src로 이동 후 압축을 풀고 설치한다.
# cd /usr/local/src
# tar zxvf mysql-5.0.67.tar.gz
# cd mysql-5.0.67
# CFLAGS="-03 -mpentiumpro" CXX=gcc CXXFLAGS="-03 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti"
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --enable-assembler --disable-shared --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --without-debug --without-docs --without-bench --with-charset=utf8 --with-collation=utf8_general_ci  --with-readline
# make && make install

Configure Options more..


※ make 도중 오류 발생
"/usr/bin/ld: cannot find -lncurses"
configure option에서 "--with-client-ldflags=-all-static"를 제거하니깐 된다..


3. DB 생성
# /usr/local/mysql/bin/mysql_install_db --user=mysql
# chown -R mysql.mysql /usr/local/mysql

4. mysql 설정파일 복사 (메모리 환경에 따라서 환경설정 파일들을 복사해줍니다.)
my-huge.cnf 1~1G
my-large.cnf 512M
my-medium.cnf 128M~256M
my-small.cnf 64M 이하
위와같이 나와있지만 위 설정은 DB서버 전용으로 했을 때 설정입니다. 기본적으로 my-medium.cnf를 복사한 다음 시스템 환경에 맞게 설정해서 사용하면 됩니다.
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

mysql 설정파일 수정(선택사항임)
# vi /etc/my.cnf
웹서버와 DB가 같은 서버에서 동작한다면 굳이 mysql을 실행하면서 외부의 접속을 Listen할 3306포트는 필요하지 않을 것이다. 아래 옵션을 활성화하여 유닉스 자체소켓을 이용하도록 하면 DB에 대한 침해를 어느정도 사전방지할 수 있다.
skip-networking       <-- 주석제거 (외부접속 차단)

5. mysqld 데몬 실행
# /usr/local/mysql/bin/mysqld_safe --user=mysql  &

접속 확인
# /usr/local/mysql/bin/mysql

6. root 비밀번호 설정/확인
# /usr/local/mysql/bin/mysqladmin -u root password '비밀번호'
# /usr/local/mysql/bin/mysql -u root -p mysql
Enter password: 비밀번호

7. mysql 라이브러리 등록
# vi /etc/ld.so.conf
/usr/local/mysql/lib/mysql
# ldconfig

8. mysql 데몬 부팅시 실행등록

- 단독 데몬 실행시
# vi /etc/rc.d/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql &

- init 프로세스에 데몬 등록
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# chkconfig mysqld on

9. 어느 위치에 있든 mysql 명령어를 사용할 수 있도록 링크
# ln -s /usr/local/mysql/bin/mysql /usr/bin

10. utf8 언어셋 설정 확인
mysql> show variables like 'c%';
+--------------------------+----------------------------------------+
| Variable_name            | Value                                  |
+--------------------------+----------------------------------------+
| character_set_client     | utf8                                   |
| character_set_connection | utf8                                   |
| character_set_database   | utf8                                   |
| character_set_filesystem | binary                                 |
| character_set_results    | utf8                                   |
| character_set_server     | utf8                                   |
| character_set_system     | utf8                                   |
| character_sets_dir       | /usr/local/mysql/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci                        |
| collation_database       | utf8_general_ci                        |
| collation_server         | utf8_general_ci                        |
| completion_type          | 0                                      |
| concurrent_insert        | 1                                      |
| connect_timeout          | 10                                     |
+--------------------------+----------------------------------------+
14 rows in set (0.00 sec)

utf8 언어셋 수동설정
위와같이 utf8 언어셋으로 설정되지 않았거나 euckr이나 다른 언어셋에서 utf8로 설정할 때는 아래와 같이 my.cnf 환경설정 파일을 수정하시면 됩니다.
# vi /etc/my.cnf
[client]
default-character-set=utf8
[mysqld]
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
default-character-set=utf8

character-set-server=utf8
collation-server=utf8_general_ci
[mysql]
default-character-set=utf8

 

출처 : http://planactor.tistory.com/82

?

공부 게시판

공부에 도움되는 글을 올려주세요.

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views931228
    read more
  2. [오라클] RAC(Real Application Cluster)이란?

    Date2023.05.01 Category데이터베이스 ByJaeSoo Views141
    Read More
  3. 데이터베이스 튜닝 (DB Tuning)

    Date2023.04.27 Category데이터베이스 ByJaeSoo Views394
    Read More
  4. BCV (Business Continuance Volume)

    Date2023.04.14 Category데이터베이스 ByJaeSoo Views124
    Read More
  5. MySQL Dump / Import (덤프 / 임포트)

    Date2016.10.10 Category데이터베이스 ByJaeSoo Views275
    Read More
  6. mysql이 cpu를 많이 점유하고, DB와의 연결상태가 좋지 않을때

    Date2016.07.05 Category데이터베이스 ByJaeSoo Views382
    Read More
  7. [Oracle] Lock 확인 및 Lock 해제

    Date2016.03.28 Category데이터베이스 ByJaeSoo Views695
    Read More
  8. Mysql slow-query를 이용한 로그 분석

    Date2015.03.17 Category데이터베이스 ByJaeSoo Views735
    Read More
  9. Mysql 데몬 문제 해결 방안 (cpulimit)

    Date2015.03.17 Category데이터베이스 ByJaeSoo Views944
    Read More
  10. mysql 5.5.x my.cnf 참고

    Date2015.03.16 Category데이터베이스 ByJaeSoo Views708
    Read More
  11. Mysql Slow query log 등록

    Date2015.03.16 Category데이터베이스 ByJaeSoo Views824
    Read More
  12. MYSQL 성능 향상 정리

    Date2015.03.16 Category데이터베이스 ByJaeSoo Views662
    Read More
  13. MySQL Query Cache 사용법

    Date2015.03.16 Category데이터베이스 ByJaeSoo Views752
    Read More
  14. Mysql 에서 Got a packet bigger than 'max_allowed_packet' bytes 오류

    Date2014.12.25 Category데이터베이스 ByJaeSoo Views966
    Read More
  15. MySQL 내부 변수 max_allowed_packet

    Date2014.12.25 Category데이터베이스 ByJaeSoo Views618
    Read More
  16. Mysql binary log 정리, 삭제 주기 설정

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views1198
    Read More
  17. MySQL 로그 파일 관리 2 - 로그 파일 남기기

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views1283
    Read More
  18. MySQL 로그 파일 관리 1 - 설정

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views1194
    Read More
  19. MySQL Binary Log 지우는 방법

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views1267
    Read More
  20. MySQL 설치/사용시 발생 에러 유형별 대처방법

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views6921
    Read More
  21. Mysql 데이터 폴더의 mysql-bin.xxx 파일들 관련 삭제 및 초기화 방법

    Date2014.11.17 Category데이터베이스 ByJaeSoo Views1154
    Read More
Board Pagination Prev 1 2 3 4 5 Next
/ 5


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너