본문 바로가기

Technical/DBMS

MySQL 5.5.4m3 Source build & Installation on OpenSUSE 11.2

반응형

1. Source 다운로드, 압축해제
다운로드 http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.4-m3.tar.gz/from/http://mirror.khlug.org/mysql/
# tar xvzf mysql-5.5.4-m3.tar.gz

2. mysql 사용자 추가
# groupadd mysql
# useradd -M -g mysql -s /bin/false mysql

3. Configure Makefile
* ForMysqlBaseDir : /usr/local/ or /dev/local/service/, etc...
# rm -rf /ForMysqlBaseDir

# ./configure --prefix=/ForMysqlBaseDir/mysql --with-mysqld-user=mysql --sysconfdir=/ForMysqlBaseDir/mysql/conf --with-unix-socket-path=/tmp/mysqld/mysql.sock --with-charset=utf8 --with-extra-charsets=all --with-plugins=innobase,myisam,semisync,partition

* Clustering을 위해서는 plugin option에 ndbcluster 추가
  Clustering 을 위해서는 cluster버전 소스를 따로 받을 것

4. Build & Install ( libtool 이 필요할지도... zypper install libtool)
# make && make install

5. cnf 복사, 설정
# cp /ForMysqlBaseDir/mysql/share/mysql/my-huge.cnf /ForMysqlBaseDir/mysql/conf/my.cnf
* cnf 편집, 디렉토리 설정
  또는 미리 준비한 my.cnf 복사(cp /home/myaccound/mysql554/my.cnf /ForMysqlBaseDir/mysql/conf)

* Sample 설정
------------------------------------------------------
[mysqld]
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
# Storage engine
default-storage-engine = innodb
# no difference between upper and lowercases
lower_case_table_names = 1
user            = mysql
pid-file        = /tmp/mysqld/mysql.pid
socket          = /tmp/mysqld/mysql.sock
port            = 3306
basedir         = /user/service/mysql
datadir         = /user/service/mysql/data
tmpdir          = /tmp
------------------------------------------------------

6. 초기데이터베이스 생성
# cd /ForMysqlBaseDir/bin
# ./mysql_install_db --user=mysql

7. Directory 생성, 권한 설정
# mkdir -p /ForMysqlBaseDir/mysql/conf
# chown -R root.mysql /ForMysqlBaseDir/mysql
# chown -R mysql.mysql /ForMysqlBaseDir/mysql/data

8. 테스트 실행
> cd /ForMysqlBaseDir/mysql/bin
> ./mysqld_safe --user=mysql &
> ./mysqladmin shutdown

9. Daemon 등록 실행
> cp /ForMysqlBaseDir/mysql/share/mysql/mysql.server /etc/init.d/mysqld
> chkconfig --add mysqld
> chkconfig | grep mysql
> chkconfig mysqld on
> /etc/init.d/mysqld start

10. Root 암호 등록

> mysqladmin -u root password 'xxxx'


반응형