의식여행

[Mysql] CentOS7.4 + Mysql5.7.21 Binary 설치 및 환경설정 본문

IT(리눅스&보안&개발)/리눅스-CentOS

[Mysql] CentOS7.4 + Mysql5.7.21 Binary 설치 및 환경설정

의식여행중 2018. 5. 16. 11:35

의존성 패키지
:  cmake, ncurses-devel

선행 패키지
: boost (https://www.boost.org/)

tar -xvzf boost_1_*
cd boost_1_*
./bootstrap.sh -- prefix=/opt/boost
./b2 install --prefix=/opt/boost --with=all

Mysql 다운로드
:  https://downloads.mysql.com/archives/community/

바이너리 설치 방법

shell> groupadd mysql shell> useradd -r -g mysql -s /bin/false mysql shell> cd /usr/local shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> mkdir mysql-files shell> chown mysql:mysql mysql-files shell> chmod 750 mysql-files shell> /etc/my.cnf (환경 설정) shell> mkdir /data shell> bin/mysqld --initialize --user=mysql shell> bin/mysql_ssl_rsa_setup shell> bin/mysqld_safe --user=mysql & # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server shell> vi /etc/profile --> export PATH=$PATH:opt/mysql/bin shell> vi ~/.bashrc --> mstart='/etc/init.d/mysql.server start or stop'

Root 패스워드 초기화 방법

shell> /opt/bin/mysqld_safe --skip-grant-tables& shell> USE mysql; shell> UPDATE user set authentication_string=password('xxxx') where user='root'; (Unknown Column password' --> authentication_string으로 해결) shell> flush privileges;

(ERROR 1820 (HY000) : You must reset your password using ALTER USER statement before executing this statement.)

shell> SET PASSWORD = PASSWORD('xxxx');





Comments