学习笔记-MySQL数据库RPM安装 20210127
RPM安装SQL数据库
从最新版本的linux系统开始,默认的是 Mariadb而不是mysql!这里依旧以mysql为例进行展示
安装之前先检查系统是否装有mysql ,这里返回空值,说明没有安装 。
WARNING! The remote SSH server rejected X11 forwarding request. Last login: Wed Jan 27 19:44:59 2021 from 192.168.0.103 [root@localhost ~]# rpm -qa | grep mysql(#这里返回空值,说明没有安装)
[root@localhost ~]#
这里执行安装命令是无效的,因为centos-7默认是Mariadb,所以执行以下命令只是更新Mariadb数据库。
#安装可用:yum install mysql
#删除可用:yum remove mysql
一、安装sql
1 [root@localhost ~]# 2 [root@localhost ~]# yum install mysql(#开始安装) 3 Loaded plugins: fastestmirror 4 Determining fastest mirrors 5 * base: mirrors.njupt.edu.cn 6 * extras: mirrors.njupt.edu.cn 7 * updates: ty1.mirror.newmediaexpress.com 8 base | 3.6 kB 00:00:00 9 extras | 2.9 kB 00:00:00 10 updates | 2.9 kB 00:00:00 11 (1/4): base/7/x86_64/group_gz | 153 kB 00:00:01 12 (2/4): extras/7/x86_64/primary_db | 222 kB 00:00:00 13 (3/4): base/7/x86_64/primary_db | 6.1 MB 00:00:01 14 (4/4): updates/7/x86_64/primary_db | 4.7 MB 00:00:11 15 Resolving Dependencies 16 --> Running transaction check 17 ---> Package mariadb.x86_64 1:5.5.68-1.el7 will be installed 18 --> Processing Dependency: perl(Sys::Hostname) for package: 1:mariadb-5.5.68-1.el7.x86_64 19 --> Processing Dependency: perl(IPC::Open3) for package: 1:mariadb-5.5.68-1.el7.x86_64 20 --> Processing Dependency: perl(Getopt::Long) for package: 1:mariadb-5.5.68-1.el7.x86_64 21 --> Processing Dependency: perl(File::Temp) for package: 1:mariadb-5.5.68-1.el7.x86_64 22 --> Processing Dependency: perl(Fcntl) for package: 1:mariadb-5.5.68-1.el7.x86_64 23 --> Processing Dependency: perl(Exporter) for package: 1:mariadb-5.5.68-1.el7.x86_64 24 --> Processing Dependency: /usr/bin/perl for package: 1:mariadb-5.5.68-1.el7.x86_64 25 --> Running transaction check 26 ---> Package perl.x86_64 4:5.16.3-297.el7 will be installed 27 --> Processing Dependency: perl-libs = 4:5.16.3-297.el7 for package: 4:perl-5.16.3-297.el7.x86_64 28 --> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-297.el7.x86_64 29 --> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-297.el7.x86_64 30 --> Processing Dependency: perl-macros for package: 4:perl-5.16.3-297.el7.x86_64 31 --> Processing Dependency: perl-libs for package: 4:perl-5.16.3-297.el7.x86_64 32 --> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-297.el7.x86_64 33 --> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-297.el7.x86_64 34 --> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-297.el7.x86_64 35 --> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-297.el7.x86_64 36 --> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-297.el7.x86_64 37 --> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-297.el7.x86_64 38 --> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-297.el7.x86_64 39 --> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-297.el7.x86_64 40 --> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-297.el7.x86_64 41 --> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-297.el7.x86_64 42 --> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-297.el7.x86_64 43 --> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-297.el7.x86_64 44 --> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-297.el7.x86_64 45 --> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-297.el7.x86_64 46 --> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-297.el7.x86_64 47 --> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-297.el7.x86_64 48 --> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-297.el7.x86_64 49 --> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-297.el7.x86_64 50 ---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed 51 ---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed 52 ---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed 53 --> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch 54 --> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch 55 --> Running transaction check 56 ---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed 57 ---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed 58 ---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed 59 ---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed 60 ---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed 61 --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch 62 --> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch 63 ---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed 64 --> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch 65 --> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch 66 ---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed 67 ---> Package perl-Socket.x86_64 0:2.010-5.el7 will be installed 68 ---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed 69 ---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed 70 ---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed 71 ---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed 72 ---> Package perl-constant.noarch 0:1.27-2.el7 will be installed 73 ---> Package perl-libs.x86_64 4:5.16.3-297.el7 will be installed 74 ---> Package perl-macros.x86_64 4:5.16.3-297.el7 will be installed 75 ---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed 76 ---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed 77 --> Running transaction check 78 ---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed 79 ---> Package perl-Pod-Escapes.noarch 1:1.04-297.el7 will be installed 80 ---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed 81 --> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch 82 --> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch 83 ---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed 84 --> Running transaction check 85 ---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed 86 ---> Package perl-parent.noarch 1:0.225-244.el7 will be installed 87 --> Finished Dependency Resolution 88 89 Dependencies Resolved 90 91 ======================================================================================================================================== 92 Package Arch Version Repository Size 93 ======================================================================================================================================== 94 Installing: 95 mariadb x86_64 1:5.5.68-1.el7 base 8.8 M 96 Installing for dependencies: 97 perl x86_64 4:5.16.3-297.el7 base 8.0 M 98 perl-Carp noarch 1.26-244.el7 base 19 k 99 perl-Encode x86_64 2.51-7.el7 base 1.5 M 100 perl-Exporter noarch 5.68-3.el7 base 28 k 101 perl-File-Path noarch 2.09-2.el7 base 26 k 102 perl-File-Temp noarch 0.23.01-3.el7 base 56 k 103 perl-Filter x86_64 1.49-3.el7 base 76 k 104 perl-Getopt-Long noarch 2.40-3.el7 base 56 k 105 perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k 106 perl-PathTools x86_64 3.40-5.el7 base 82 k 107 perl-Pod-Escapes noarch 1:1.04-297.el7 base 52 k 108 perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k 109 perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k 110 perl-Pod-Usage noarch 1.63-3.el7 base 27 k 111 perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k 112 perl-Socket x86_64 2.010-5.el7 base 49 k 113 perl-Storable x86_64 2.45-3.el7 base 77 k 114 perl-Text-ParseWords noarch 3.29-4.el7 base 14 k 115 perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k 116 perl-Time-Local noarch 1.2300-2.el7 base 24 k 117 perl-constant noarch 1.27-2.el7 base 19 k 118 perl-libs x86_64 4:5.16.3-297.el7 base 689 k 119 perl-macros x86_64 4:5.16.3-297.el7 base 44 k 120 perl-parent noarch 1:0.225-244.el7 base 12 k 121 perl-podlators noarch 2.5.1-3.el7 base 112 k 122 perl-threads x86_64 1.87-4.el7 base 49 k 123 perl-threads-shared x86_64 1.43-6.el7 base 39 k 124 125 Transaction Summary 126 ======================================================================================================================================== 127 Install 1 Package (+27 Dependent packages) 128 129 Total download size: 20 M 130 Installed size: 85 M 131 Is this ok [y/d/N]: y 132 Downloading packages: 133 warning: /var/cache/yum/x86_64/7/base/packages/perl-5.16.3-297.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYTA 134 Public key for perl-5.16.3-297.el7.x86_64.rpm is not installed 135 (1/28): perl-5.16.3-297.el7.x86_64.rpm | 8.0 MB 00:00:02 136 (2/28): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00 137 (3/28): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:00 138 (4/28): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00 139 (5/28): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00 140 (6/28): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00 141 (7/28): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00 142 (8/28): perl-Getopt-Long-2.40-3.el7.noarch.rpm | 56 kB 00:00:00 143 (9/28): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00 144 (10/28): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00 145 (11/28): perl-Pod-Escapes-1.04-297.el7.noarch.rpm | 52 kB 00:00:00 146 (12/28): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:00 147 (13/28): mariadb-5.5.68-1.el7.x86_64.rpm | 8.8 MB 00:00:03 148 (14/28): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00 149 (15/28): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00 150 (16/28): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00 151 (17/28): perl-Socket-2.010-5.el7.x86_64.rpm | 49 kB 00:00:00 152 (18/28): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00 153 (19/28): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00 154 (20/28): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:00 155 (21/28): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00 156 (22/28): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00 157 (23/28): perl-macros-5.16.3-297.el7.x86_64.rpm | 44 kB 00:00:00 158 (24/28): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00 159 (25/28): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00 160 (26/28): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:00 161 (27/28): perl-libs-5.16.3-297.el7.x86_64.rpm | 689 kB 00:00:00 162 (28/28): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00 163 ---------------------------------------------------------------------------------------------------------------------------------------- 164 Total 5.5 MB/s | 20 MB 00:00:03 165 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 166 Importing GPG key 0xF4A80EB5: 167 Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>" 168 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 169 Package : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda) 170 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 171 Is this ok [y/N]: y 172 Running transaction check 173 Running transaction test 174 Transaction test succeeded 175 Running transaction 176 Installing : 1:perl-parent-0.225-244.el7.noarch 1/28 177 Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 2/28 178 Installing : perl-podlators-2.5.1-3.el7.noarch 3/28 179 Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 4/28 180 Installing : 1:perl-Pod-Escapes-1.04-297.el7.noarch 5/28 181 Installing : perl-Encode-2.51-7.el7.x86_64 6/28 182 Installing : perl-Text-ParseWords-3.29-4.el7.noarch 7/28 183 Installing : perl-Pod-Usage-1.63-3.el7.noarch 8/28 184 Installing : 4:perl-libs-5.16.3-297.el7.x86_64 9/28 185 Installing : perl-Storable-2.45-3.el7.x86_64 10/28 186 Installing : perl-Exporter-5.68-3.el7.noarch 11/28 187 Installing : perl-constant-1.27-2.el7.noarch 12/28 188 Installing : perl-Socket-2.010-5.el7.x86_64 13/28 189 Installing : perl-Time-Local-1.2300-2.el7.noarch 14/28 190 Installing : perl-Carp-1.26-244.el7.noarch 15/28 191 Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 16/28 192 Installing : perl-PathTools-3.40-5.el7.x86_64 17/28 193 Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 18/28 194 Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 19/28 195 Installing : perl-File-Temp-0.23.01-3.el7.noarch 20/28 196 Installing : perl-File-Path-2.09-2.el7.noarch 21/28 197 Installing : perl-threads-shared-1.43-6.el7.x86_64 22/28 198 Installing : perl-threads-1.87-4.el7.x86_64 23/28 199 Installing : perl-Filter-1.49-3.el7.x86_64 24/28 200 Installing : 4:perl-macros-5.16.3-297.el7.x86_64 25/28 201 Installing : perl-Getopt-Long-2.40-3.el7.noarch 26/28 202 Installing : 4:perl-5.16.3-297.el7.x86_64 27/28 203 Installing : 1:mariadb-5.5.68-1.el7.x86_64 28/28 204 Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/28 205 Verifying : perl-threads-shared-1.43-6.el7.x86_64 2/28 206 Verifying : perl-Storable-2.45-3.el7.x86_64 3/28 207 Verifying : 4:perl-libs-5.16.3-297.el7.x86_64 4/28 208 Verifying : perl-Exporter-5.68-3.el7.noarch 5/28 209 Verifying : perl-constant-1.27-2.el7.noarch 6/28 210 Verifying : perl-PathTools-3.40-5.el7.x86_64 7/28 211 Verifying : perl-Socket-2.010-5.el7.x86_64 8/28 212 Verifying : 1:perl-parent-0.225-244.el7.noarch 9/28 213 Verifying : 1:perl-Pod-Escapes-1.04-297.el7.noarch 10/28 214 Verifying : perl-File-Temp-0.23.01-3.el7.noarch 11/28 215 Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 12/28 216 Verifying : perl-Time-Local-1.2300-2.el7.noarch 13/28 217 Verifying : perl-Carp-1.26-244.el7.noarch 14/28 218 Verifying : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 15/28 219 Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 16/28 220 Verifying : perl-Pod-Usage-1.63-3.el7.noarch 17/28 221 Verifying : perl-Encode-2.51-7.el7.x86_64 18/28 222 Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 19/28 223 Verifying : perl-podlators-2.5.1-3.el7.noarch 20/28 224 Verifying : perl-File-Path-2.09-2.el7.noarch 21/28 225 Verifying : perl-threads-1.87-4.el7.x86_64 22/28 226 Verifying : 1:mariadb-5.5.68-1.el7.x86_64 23/28 227 Verifying : perl-Filter-1.49-3.el7.x86_64 24/28 228 Verifying : perl-Getopt-Long-2.40-3.el7.noarch 25/28 229 Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 26/28 230 Verifying : 4:perl-5.16.3-297.el7.x86_64 27/28 231 Verifying : 4:perl-macros-5.16.3-297.el7.x86_64 28/28 232 233 Installed: 234 mariadb.x86_64 1:5.5.68-1.el7 235 236 Dependency Installed: 237 perl.x86_64 4:5.16.3-297.el7 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 238 perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 239 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 240 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-297.el7 perl-Pod-Perldoc.noarch 0:3.20-4.el7 241 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 242 perl-Socket.x86_64 0:2.010-5.el7 perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 243 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7 244 perl-libs.x86_64 4:5.16.3-297.el7 perl-macros.x86_64 4:5.16.3-297.el7 perl-parent.noarch 1:0.225-244.el7 245 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7
Complete!
二、下载mysql的repo源
2.1下载 # wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm -bash: wget: command not found
2.2 当使用wget下载linux下的类库的时候,出现的问题,这里已经说了,主要是linux 下没有找到wget 这个库,所以我们可以进行更新一下:
使用yum进行安装: yum -y install wget
[root@localhost ~]# yum -y install wget(#安装wget 这个库)
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================
Installing:
wget x86_64 1.14-18.el7_6.1 base 547 k
Transaction Summary
========================================================================================================================================
Install 1 Package
Total download size: 547 k
Installed size: 2.0 M
Downloading packages:
wget-1.14-18.el7_6.1.x86_64.rpm | 547 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-18.el7_6.1.x86_64 1/1
Verifying : wget-1.14-18.el7_6.1.x86_64 1/1
Installed:
wget.x86_64 0:1.14-18.el7_6.1
Complete!
2.3 继续下载mysql的repo源:
1 [root@localhost ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 2 --2021-01-27 20:36:15-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 3 Resolving repo.mysql.com (repo.mysql.com)... 96.17.188.242 4 Connecting to repo.mysql.com (repo.mysql.com)|96.17.188.242|:80... connected. 5 HTTP request sent, awaiting response... 200 OK 6 Length: 6140 (6.0K) [application/x-redhat-package-manager] 7 Saving to: ‘mysql-community-release-el7-5.noarch.rpm’ 8 9 100%[============================================================================================================================================>] 6,140 10 11 2021-01-27 20:36:17 (26.1 KB/s) - ‘mysql-community-release-el7-5.noarch.rpm’ saved [6140/6140]
2.4继续安装mysql-community-release-el7-5.noarch.rpm包
[root@localhost ~]# rpm -qa | grep mysql(# rpm -qa | gerp [软件名称] # 查询软件是否被安装)
mysql-community-release-el7-5.noarch
1 [root@localhost ~]# sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm 2 Preparing... ################################# [100%] 3 Updating / installing... 4 1:mysql-community-release-el7-5 ################################# [100%]
2.5安装这个包后,会获得两个mysql的yum repo源:
/etc/yum.repos.d/mysql-community.repo,
/etc/yum.repos.d/mysql-community-source.repo
1 [root@localhost ~]# cd /etc/yum.repos.d(#打开etc目录查看一下) 2 [root@localhost yum.repos.d]# ls 3 CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo mysql-community.repo 4 CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo CentOS-x86_64-kernel.repo mysql-community-source.repo 5 [root@localhost yum.repos.d]#
2.6、正式安装mysql
# sudo yum install mysql-server