>  기사  >  데이터 베이스  >  Centos7 설치 mysql5.7 예제 분석

Centos7 설치 mysql5.7 예제 분석

PHPz
PHPz앞으로
2023-06-02 20:21:121406검색

mysql 다운로드 및 설치

rpm 설치 패키지 다운로드

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
--2022-01-22 03:01:53--  http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm [following]
--2022-01-22 03:01:54--  https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm [following]
--2022-01-22 03:01:55--  https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.36.253.13
Connecting to repo.mysql.com (repo.mysql.com)|23.36.253.13|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9116 (8.9K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-8.noarch.rpm'
 
100%[=========================================================================================================================================================================>] 9,116       --.-K/s   in 0s      
 
2022-01-22 03:01:55 (249 MB/s) - ‘mysql57-community-release-el7-8.noarch.rpm' saved [9116/9116]

Install

yum localinstall mysql57-community-release-el7-8.noarch.rpm
(py3) [root@localhost opt]# yum localinstall mysql57-community-release-el7-8.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Examining mysql57-community-release-el7-8.noarch.rpm: mysql57-community-release-el7-8.noarch
Marking mysql57-community-release-el7-8.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-8 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===================================================================================================================================================================================================================
 Package                                                  Arch                                  Version                               Repository                                                              Size
===================================================================================================================================================================================================================
Installing:
 mysql57-community-release                                noarch                                el7-8                                 /mysql57-community-release-el7-8.noarch                                8.2 k
 
Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package
 
Total size: 8.2 k
Installed size: 8.2 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql57-community-release-el7-8.noarch                                                                                                                                                          1/1 
  Verifying  : mysql57-community-release-el7-8.noarch                                                                                                                                                          1/1 
 
Installed:
  mysql57-community-release.noarch 0:el7-8                                                                                                                                                                         
 
Complete!

설치 상태 보기

(py3) [root@localhost opt]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64       MySQL Connectors Community           167
mysql-tools-community/x86_64            MySQL Tools Community                 82
mysql57-community/x86_64                MySQL 5.7 Community Server           564

서버 설치

yum -y install mysql-community-server
(py3) [root@localhost opt]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.37-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.37-1.el7 for package: mysql-community-server-5.7.37-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.37-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.37-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.37-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.37-1.el7 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.7.37-1.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===================================================================================================================================================================================================================
 Package                                                   Arch                                      Version                                            Repository                                            Size
===================================================================================================================================================================================================================
Installing:
 mysql-community-server                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                    174 M
Installing for dependencies:
 mysql-community-client                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                     25 M
 mysql-community-common                                    x86_64                                    5.7.37-1.el7                                       mysql57-community                                    311 k
 mysql-community-libs                                      x86_64                                    5.7.37-1.el7                                       mysql57-community                                    2.4 M
 
Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)
 
Total download size: 202 M
Installed size: 878 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY               ]  0.0 B/s | 767 kB  --:--:-- ETA 
Public key for mysql-community-common-5.7.37-1.el7.x86_64.rpm is not installed
(1/4): mysql-community-common-5.7.37-1.el7.x86_64.rpm                                                                                                                                       | 311 kB  00:00:00     
(2/4): mysql-community-libs-5.7.37-1.el7.x86_64.rpm                                                                                                                                         | 2.4 MB  00:00:04     
(3/4): mysql-community-client-5.7.37-1.el7.x86_64.rpm                                                                                                                                       |  25 MB  00:01:01     
(4/4): mysql-community-server-5.7.37-1.el7.x86_64.rpm                                                                                                                                       | 174 MB  00:03:40     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              917 kB/s | 202 MB  00:03:45     
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    : mysql57-community-release-el7-8.noarch (@/mysql57-community-release-el7-8.noarch)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
 
 
Public key for mysql-community-server-5.7.37-1.el7.x86_64.rpm is not installed
 
 
 Failing package is: mysql-community-server-5.7.37-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

이 문제는 여기에서 발견되었습니다.

Public key for mysql-community-server-5.7.37-1.el7.x86_64.rpm is not installed
 
 Failing package is: mysql-community-server-5.7.37-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

참고:

MySQL은 CentOS7에서 충전되므로, MySQL은 더 이상 지원되지 않습니다. 대신, MariaDB는 CentOS7에 통합되어 있습니다. MySQL을 설치하면 MariaDB 파일과 충돌합니다.

설치하는 경우 MariaDB를 제거해야 합니다. 또한 올바른 설치 패키지 설치와 설치 순서에 주의하세요.

위 내용은 Centos7 설치 mysql5.7 예제 분석의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 yisu.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제