본문 바로가기

리눅스

[리눅스] MySQL innodb 설치

반응형

MySQL innodb 설치

2.1 MySQL 계정 생성

[root@sangchul mysql-5.1.56]# useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 mysql

2.2 MySQL config(innodb 활성화)

[root@sangchul mysql-5.1.49]# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-plugins=innobase,innodb_plugin --with-charset=euckr --with-extra-charsets=all

2.3 MySQL make && make install

[root@sangchul mysql-5.1.56]# make && make install

 

MySQL 용도별

my-small.cnf : 64M
my-medium.cnf : 128-256M
my-large.cnf : 512M
my-huge.cnf : 1~2G
my-innodb-heavy-4G.cnf : innodb

 

2.4 MySQL 설정 파일 복사

[root@sangchul mysql-5.1.56]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

2.5 MySQL config 변경-innodb 활성화(/etc/my.cnf)

[mysqld]
..
# 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
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

2.6 MySQL 초기화

[root@sangchul mysql-5.1.56]# /usr/local/mysql/bin/mysql_install_db

2.7 data 디렉토 권한 변경

[root@sangchul mysql-5.1.56]# chown -R mysql.mysql /usr/local/mysql/data
[root@sangchul mysql-5.1.56]# ls -l /usr/local/mysql | grep data
drwxr-xr-x 2 mysql mysql 4096 Apr 23 12:05 data

2.8 MySQL 실행

[root@sangchul mysql-5.1.56]# /usr/local/mysql/bin/mysqld_safe &

2.9 innodb 활성화 확인

[root@sangchul mysql-5.1.56]# /usr/local/mysql/bin/mysql
mysql> SHOW VARIABLES LIKE 'have_innodb';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_innodb | YES |
+---------------+-------+
1 row in set (0.00 sec)

 

728x90
반응형