'MySQL'에 해당되는 글 1건

  1. 2010.10.28 CentOS5에 mysql5 설치
Linux2010. 10. 28. 15:07


CentOS 5.5 버전에 mysql 5.1.51 설치.


1. 다운로드 
http://www.mysql.com/downloads/mysql/#downloads  에서 mysql-5.1.51.tar.gz  파일을 다운로드 받는다.






2. 설치

* 사용자 홈디렉토리 없이 mysql 계정 생성
#useradd mysql -M -s /bin/false

* mysql을 설치할 디렉토리 생성
#mkdir /usr/local/mysql

* 압축을  풀고 설치 디렉토리로 이동
#cd /usr/local/src/apm
#tar zxvf mysql-5.1.51.tar.gz 
#cd mysql-5.1.51

* 컴파일 옵션
#./configure \
--prefix=/usr/local/mysql \
--with-charset=euckr \
--with-extra-charsets=all \
--disable-shared \
--enable-assembler \
--with-mysqld-user="mysql" \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--with-readline \
--without-debug \
--without-docs

--prefix=/usr/local/mysql               : install architecture-independent files in PREFIX
--with-charset=euckr                      :  Default character set
--with-extra-charsets=all                :  Use charsets in addition to default 
--disable-shared                           : --enable-shared[=PKGS]  build shared libraries [default=yes]
--enable-assembler                       :  Use assembler versions of some string
--with-mysqld-user="mysql"           :  What user the mysqld daemon shall be run as.
--with-client-ldflags=-all-static        :  Extra linking arguments for client
--with-mysqld-ldflags=-all-static     :  Extra linking arguments for mysqld
--with-readline                              :  Use system readline instead of bundled copy.
--without-debug                            : Add debug code
--without-docs                              :  Skip building of the documentation.


* 컴파일
#make & make install

* mysql 설정파일 복사
#cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf 

* 시스템 메모리 크기에따른 설정파일
my-huge.cnf       1G 이상
my-large.cnf       512M ~ 1G
my-medium.cnf  128M ~ 256M
my-small.cnf      64M 이하


* 기본 DB 생성
#/usr/local/mysql/bin/mysql_install_db

* mysql data 디렉토리 권한 변경
#chown -Rf mysql:mysql /usr/local/mysql/var

* mysql 데몬 실행하기
#/usr/local/mysql/bin/mysqld_safe &


* /etc/rc.d/rc.local 파일에 데몬 실행 스크립트를 추가하여 서버 부팅시 자동으로 실행되도록 한다.
#vi /etc/rc.d/rc.local
/usr/local/mysql/bin/mysqld_safe &



* PATH를 설정하여 어디서든 mysql 관련 명령어를 실행할수 있도록 한다.
#vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin




'Linux' 카테고리의 다른 글

SSL 인증서 비밀번호 제거하는 방법  (0) 2013.06.07
PHP5 설치  (0) 2010.10.28
아파치 설치  (0) 2010.10.28
[Mysql] characterset이 euckr인 mysql 서버에서 utf8 Database 생성하기  (0) 2010.10.28
webalizer 설치 및 사용법  (0) 2010.08.04
Posted by requireme