1. Mysql 8.0 설치
[root@localhost ~]# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
[root@localhost ~]# yum install -y mysql-server
아래와 같은 이유로 설치 실패
- gpg key issue ( https://dev.mysql.com/doc/refman/5.7/en/checking-gpg-signature.html )
Failing package is: mysql-community-client-plugins-8.0.28-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
2. 아래 명령어로 URL 키 import 후 진행
[root@localhost ~]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
[root@localhost ~]# yum install -y mysql-server
3. 설치 확인
[root@localhost ~]# mysql --version
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
4. Mysql 실행
[root@localhost ~]# systemctl enable mysqld
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-04-15 03:45:46 EDT; 20s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 21526 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 21551 (mysqld)
Status: "Server is operational"
CGroup: /system.slice/mysqld.service
└─21551 /usr/sbin/mysqld
Apr 15 03:45:29 localhost.localdomain systemd[1]: Starting MySQL Server...
Apr 15 03:45:46 localhost.localdomain systemd[1]: Started MySQL Server.
[root@localhost ~]#
5. 초기 비밀번호 확인 ( 아래의 경우 [ hgkugABvH9?; ]
[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log
2022-04-15T07:44:52.947146Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: hgkugABvH9?;
6. Mysql 접속
[root@localhost ~]# mysql -uroot -p
Enter password:
7. Password 변경 ( 아래의 경우 [ 1234qwer!@#$ ] 로 변경 )
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '1234qwer!@#$';
Query OK, 0 rows affected (0.08 sec)
8. Mysql 접속 및 user 테이블 확인
mysql> use mysql;
mysql> select host, user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
4 rows in set (0.00 sec)
'Server > 환경 구축 - Centos' 카테고리의 다른 글
| [Linux] CentOS 7 MySQL 계정 권한 설정 (0) | 2022.04.25 |
|---|---|
| [Linux] CentOS 7 MySQL 계정 추가 및 외부 접속 허용 (0) | 2022.04.18 |
| [Linux] CentOS 7 FTP 설정 (0) | 2022.04.01 |
| [Linux] CentOS 7 SSH 설정 (0) | 2022.03.31 |
| [Linux] CentOS 7 환경 구축 (0) | 2022.03.31 |