본문으로 바로가기

mysql 8.0.29 설치

category 서버 & 시스템/Linux 2022. 6. 14. 08:50
반응형

설치환경

CentOS Linux release 7.8.2003 (Core)


 

1. mysql 설치

# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.29-1.el7.x86_64.rpm-bundle.tar
# mkdir mysql
# tar -xvf mysql-8.0.29-1.el7.x86_64.rpm-bundle.tar -C mysql

 

2. mysql 패키지 설치

# cd mysql
# rpm -ivh mysql-community-common-8.0.29-1.el7.x86_64.rpm
# rpm -ivh mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm
# yum remove mysql-libs -y
# rpm -ivh mysql-community-libs-8.0.29-1.el7.x86_64.rpm
# rpm -ivh mysql-community-libs-compat-8.0.29-1.el7.x86_64.rpm
# yum install openssl-devel -y
# rpm -ivh mysql-community-devel-8.0.29-1.el7.x86_64.rpm
# rpm -ivh mysql-community-client-8.0.29-1.el7.x86_64.rpm
# rpm -ivh mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm
# rpm -ivh mysql-community-server-8.0.29-1.el7.x86_64.rpm

 

3. mysql 기본 설정

# grep "passsword" /var/log/mysqld.log​


# mysql -uroot -p

> ALTER USER 'root'@'localhost' IDENTIFIED BY '[새로운패스워드]';
> use mysql;
> update user set host='%' where user='root';

 

 

 

▶ 설치 시 오류 발생

더보기

** 오류발생 1 **

mysql-community-server 패키지 설치시 오류 발생 

** 해결방법 **

오류가 발생해서 그냥 의존성 무시하고 설치 진행

# rpm -ivh --nodeps mysql-community-server-8.0.29-1.el7.x86_64.rpm

 

** 오류발생 2 **

mysql 데몬 시작 시 오류발생, 로그에서 아래와 같이 확인

# cat /var/log/message
Jun 14 08:17:47 lelabo92-169144 systemd: Stopped MySQL Server.
Jun 14 08:17:47 lelabo92-169144 systemd: Starting MySQL Server...
Jun 14 08:17:48 lelabo92-169144 mysqld_pre_systemd: /usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Jun 14 08:17:48 lelabo92-169144 mysqld: /usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Jun 14 08:17:48 lelabo92-169144 systemd: mysqld.service: main process exited, code=exited, status=127/n/a
Jun 14 08:17:48 lelabo92-169144 systemd: Failed to start MySQL Server.

** 해결방법 **

필요 패키지 설치

# yum install libaio

 

** 오류발생 3 **

데몬 시작 시 mysqld.log 에서 아래와 같이 확인

# cat /var/log/mysqld.log
2022-06-13T23:20:41.689168Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2022-06-13T23:20:41.689346Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-06-13T23:20:41.689397Z 0 [ERROR] [MY-010119] [Server] Aborting

 

** 해결방법 ** 

# mv /var/lib/mysql /var/lib/mysql_bak

 

 

 

 

 

추가 참조 URL

https://xinet.kr/?p=3294

 

반응형