MySQL 5.6 소스 설치

리눅스/MySQL|2019. 8. 29. 14:42
반응형

mysql 5.5 이상 버전 부터 cmake 를 이용하여 설치 하기 때문에 cmake를 먼저 설치 후 mysql 설치를 진행 합니다.

# cd  /usr/local/src

 

# groupadd mysql
# useradd -g mysql mysql

 

# wget https://src.fedoraproject.org/repo/pkgs/cmake/cmake-2.8.5.tar.gz/3c5d32cec0f4c2dc45f4c2e84f4a20c5/cmake-2.8.5.tar.gz
# tar zxvfp ./cmake-2.8.5.tar.gz
# cd  ./cmake-2.8.5
# ./bootstrap
# make
# make install

# cd ../

# wget https://distfiles.macports.org/mysql56/mysql-5.6.45.tar.gz
# tar xvzf mysql-5.6.45.tar.gz
# cd mysql-5.6.45
# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1

 

* euckr 으로 설치를 원할 경우 위 파란 부분을 각각 euckr 과 euckr_korean_ci 로 변경


# make
# make install

# cp -arp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
# cp -arpf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
 

소유권 그룹 권한등을 변경 하여 줍니다.

# chown -R mysql:mysql /usr/local/mysql/
# chmod 700 /etc/init.d/mysqld
# chmod 711 /usr/local/mysql
# chmod 700 /usr/local/mysql/data
# chmod 751 /usr/local/mysql/bin
# chmod 750 /usr/local/mysql/bin/*
# chmod 755 /usr/local/mysql/bin/mysql
# chmod 755 /usr/local/mysql/bin/mysqldump
 

mysql 명령어를 사용할 수 있게 환경변수를 등록하여 줍니다.

# vi /etc/profile
PATH="$PATH:/usr/local/mysql/bin"

# source /etc/profile

# chkconfig mysqld --add
# chkconfig mysqld on
# /etc/init.d/mysqld start

 

 

[출처] https://idchowto.com/?p=26547

반응형

댓글()