2011년 8월 23일 화요일

Mysql on Linux

4.1대사용한 설치내용인데.. 조금 편집해  봤습니다.

# ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all --with-collation=utf8_general_ci --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-debug --with-unix-socket-path=/tmp/mysql.sock --localstatedir=/usr/local/mysql/data --with-low-memory

# make
# make install
// configure 오류 발생시 => rm config.cache 후 configure 재입력
// make 오류발생시 => # make clean
// make install

# groupadd mysql
# useradd -g mysql mysql

# cd /usr/local/mysql
# mkdir data
# vi /etc/my.cnf
아래 부분에서 해당되는 부분을 편집
==================================
datadir=/usr/local/mysql/data

[mysql.server]
user=mysql
basedir=/usr/local/mysql

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/usr/local/mysql/data/mysql.pid
==================================
:wq

//error log 는 그냥두고.. pid 와 data 만 /usr/local/mysql/data 에 쌓이게 수정한겁니다.

# ./bin/mysql_install_db
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .

# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf //램이 128정도
# cp /usr/local/mysql/share/mysql/my-large.cnf /etc/my.cnf //램이 521정도
# cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf //램이 1G~2G정도

innodb 를 사용하기 위해 아래의 부분 주석처리를 삭제해준다.
# vi /etc/my.cnf
================================================================================
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql/data/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/data/
innodb_log_arch_dir = /usr/local/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
================================================================================

// mysql 실행방법1
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 3 mysqld on
# /etc/rc.d/init.d/mysqld start

// mysql 실행방법2
# /usr/local/mysql/bin/mysqld_safe --user=mysql --default-character-set=utf8 &
# vi /etc/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql --default-character-set=utf8 &
추가해서 부팅시 mysql 실행되도록한다

//실행되고 나서 root 패스입력..
# /usr/local/mysql/bin/mysqladmin -u root password '패스워드'

댓글 없음:

댓글 쓰기