1. RPM 파일 다운로드
[root@localhost ~]# curl -sSLO https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
[root@localhost ~]# ls
anaconda-ks.cfg mysql80-community-release-el7-5.noarch.rpm
2. MD5 체크섬 확인
[root@localhost ~]# md5sum mysql80-community-release-el7-5.noarch.rpm
e2bd920ba15cd3d651c1547661c60c7c mysql80-community-release-el7-5.noarch.rpm
3. 1번에서 다운로드 받은 RPM 파일 이용하여 설치
[root@localhost ~]# sudo rpm -ivh mysql80-community-release-el7-5.noarch.rpm warning: mysql80-community-release-el7-5.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql80-community-release-el7-5 ################################# [100%] [root@localhost ~]# sudo yum install mysql-server Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: la.mirrors.clouvider.net * extras: mirror.san.fastserv.com * updates: mirrors.vcea.wsu.edu base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 mysql-connectors-community | 2.6 kB 00:00:00 mysql-tools-community | 2.6 kB 00:00:00 mysql80-community | 2.6 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/3): mysql-tools-community/x86_64/primary_db | 92 kB 00:00:00 (2/3): mysql-connectors-community/x86_64/primary_db | 99 kB 00:00:00 (3/3): mysql80-community/x86_64/primary_db | 239 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package mysql-community-server.x86_64 0:8.0.33-1.el7 will be installed --> Processing Dependency: mysql-community-common(x86-64) = 8.0.33-1.el7 for package: mysql-community-server-8.0.33-1.el7.x86_64 --> Processing Dependency: mysql-community-icu-data-files = 8.0.33-1.el7 for package: mysql-community-server-8.0.33-1.el7.x86_64 --> Processing Dependency: mysql-community-client(x86-64) >= 8.0.11 for package: mysql-community-server-8.0.33-1.el7.x86_64 --> Processing Dependency: net-tools for package: mysql-community-server-8.0.33-1.el7.x86_64 --> Running transaction check ---> Package mysql-community-client.x86_64 0:8.0.33-1.el7 will be installed --> Processing Dependency: mysql-community-client-plugins = 8.0.33-1.el7 for package: mysql-community-client-8.0.33-1.el7.x86_64 --> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.11 for package: mysql-community-client-8.0.33-1.el7.x86_64 ---> Package mysql-community-common.x86_64 0:8.0.33-1.el7 will be installed ---> Package mysql-community-icu-data-files.x86_64 0:8.0.33-1.el7 will be installed ---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed --> Running transaction check ---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64 --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-5.7.2-49.el7_9.2.x86_64 --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64 ---> Package mysql-community-client-plugins.x86_64 0:8.0.33-1.el7 will be installed ---> Package mysql-community-libs.x86_64 0:8.0.33-1.el7 will be obsoleting --> Running transaction check ---> Package mysql-community-libs-compat.x86_64 0:8.0.33-1.el7 will be obsoleting --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================= Installing: mysql-community-libs x86_64 8.0.33-1.el7 mysql80-community 1.5 M replacing mariadb-libs.x86_64 1:5.5.68-1.el7 mysql-community-libs-compat x86_64 8.0.33-1.el7 mysql80-community 670 k replacing mariadb-libs.x86_64 1:5.5.68-1.el7 mysql-community-server x86_64 8.0.33-1.el7 mysql80-community 64 M Installing for dependencies: mysql-community-client x86_64 8.0.33-1.el7 mysql80-community 16 M mysql-community-client-plugins x86_64 8.0.33-1.el7 mysql80-community 3.6 M mysql-community-common x86_64 8.0.33-1.el7 mysql80-community 664 k mysql-community-icu-data-files x86_64 8.0.33-1.el7 mysql80-community 2.1 M net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k Transaction Summary ================================================================================================================================================================= Install 3 Packages (+5 Dependent packages) Total download size: 89 M Is this ok [y/d/N]: y Downloading packages: warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd 29: NOKEY Public key for mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm is not installed (1/8): mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm | 3.6 MB 00:00:00 (2/8): mysql-community-common-8.0.33-1.el7.x86_64.rpm | 664 kB 00:00:00 (3/8): mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm | 2.1 MB 00:00:00 (4/8): mysql-community-libs-8.0.33-1.el7.x86_64.rpm | 1.5 MB 00:00:00 (5/8): mysql-community-libs-compat-8.0.33-1.el7.x86_64.rpm | 670 kB 00:00:00 (6/8): mysql-community-client-8.0.33-1.el7.x86_64.rpm | 16 MB 00:00:01 (7/8): net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:00 (8/8): mysql-community-server-8.0.33-1.el7.x86_64.rpm | 64 MB 00:00:01 ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 36 MB/s | 89 MB 00:00:02 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Importing GPG key 0x3A79BD29: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: 859b e8d7 c586 f538 430b 19c2 467b 942d 3a79 bd29 Package : mysql80-community-release-el7-5.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Is this ok [y/N]: y Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Importing GPG key 0x5072E1F5: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5 Package : mysql80-community-release-el7-5.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Is this ok [y/N]: y Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : mysql-community-client-plugins-8.0.33-1.el7.x86_64 1/9 Installing : mysql-community-common-8.0.33-1.el7.x86_64 2/9 Installing : mysql-community-libs-8.0.33-1.el7.x86_64 3/9 Installing : mysql-community-client-8.0.33-1.el7.x86_64 4/9 Installing : mysql-community-icu-data-files-8.0.33-1.el7.x86_64 5/9 Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 6/9 Installing : mysql-community-server-8.0.33-1.el7.x86_64 7/9 Installing : mysql-community-libs-compat-8.0.33-1.el7.x86_64 8/9 Erasing : 1:mariadb-libs-5.5.68-1.el7.x86_64 9/9 Verifying : mysql-community-common-8.0.33-1.el7.x86_64 1/9 Verifying : mysql-community-server-8.0.33-1.el7.x86_64 2/9 Verifying : mysql-community-libs-compat-8.0.33-1.el7.x86_64 3/9 Verifying : mysql-community-client-plugins-8.0.33-1.el7.x86_64 4/9 Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 5/9 Verifying : mysql-community-libs-8.0.33-1.el7.x86_64 6/9 Verifying : mysql-community-icu-data-files-8.0.33-1.el7.x86_64 7/9 Verifying : mysql-community-client-8.0.33-1.el7.x86_64 8/9 Verifying : 1:mariadb-libs-5.5.68-1.el7.x86_64 9/9 Installed: mysql-community-libs.x86_64 0:8.0.33-1.el7 mysql-community-libs-compat.x86_64 0:8.0.33-1.el7 mysql-community-server.x86_64 0:8.0.33-1.el7 Dependency Installed: mysql-community-client.x86_64 0:8.0.33-1.el7 mysql-community-client-plugins.x86_64 0:8.0.33-1.el7 mysql-community-common.x86_64 0:8.0.33-1.el7 mysql-community-icu-data-files.x86_64 0:8.0.33-1.el7 net-tools.x86_64 0:2.0-0.25.20131004git.el7 Replaced: mariadb-libs.x86_64 1:5.5.68-1.el7 Complete! |
4. 설치한 mysql 버전 확인
[root@localhost ~]# mysqld -V
/usr/sbin/mysqld Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
5. mysql 서비스 상태 확인
[root@localhost ~]# systemctl status mysqld
-
- mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
6. mysql 서비스 시작 및 서버 시작 시 서비스 시작되도록 활성화
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# systemctl enable mysqld
7. 초기 암호 확인
[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log
2023-06-08T09:48:47.371667Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: )jqM!ivMt31e
8. 초기 암호 이용하여 mysql 접속 테스트
[root@localhost ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.33 Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> |
9. 초기 암호 변경 및 원격 접속 허용 절차
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssw0rd'; Query OK, 0 rows affected (0.01 sec) mysql> SELECT Host,User,plugin,authentication_string FROM mysql.user; +-----------+------------------+-----------------------+------------------------------------------------------------------------+ | Host | User | plugin | authentication_string | +-----------+------------------+-----------------------+------------------------------------------------------------------------+ | localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | root | caching_sha2_password | $A$005$[=]x3%DFy t1e86LISK7K1yubD7efwqIBg9xa1UmOryc3I0j.Jwd18 | +-----------+------------------+-----------------------+------------------------------------------------------------------------+ 4 rows in set (0.00 sec) mysql> CREATE USER 'root'@'%' identified by 'P@ssw0rd'; Query OK, 0 rows affected (0.01 sec) mysql> GRANT ALL PRIVILEGES ON *.* to 'root'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> SELECT Host,User,plugin,authentication_string FROM mysql.user; +-----------+------------------+-----------------------+------------------------------------------------------------------------+ | Host | User | plugin | authentication_string | +-----------+------------------+-----------------------+------------------------------------------------------------------------+ | % | root | caching_sha2_password | $A$005$MBQ+E?xY:4>jp~m&;pMi6Fy/CNVLncd34A8qarBizu1r01NnKNca16.e5me4 | | localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | root | caching_sha2_password | $A$005$[=]x3%DFy t1e86LISK7K1yubD7efwqIBg9xa1UmOryc3I0j.Jwd18 | +-----------+------------------+-----------------------+------------------------------------------------------------------------+ 5 rows in set (0.00 sec) |
10. HeidiSQL 설치 후 원격에서 접속 테스트
## mysql은 Default로 포트 번호 3306 사용
'Database' 카테고리의 다른 글
load test using sysbench for mysql (1) | 2023.06.11 |
---|