CentOS7 下的mysql安装与配置 包括第一:CentOS7安装nexu 第二:CentOS安装docker 之前虽然也安装过多次mysql,但每次都会遇到各种小问题,这次记录下来,以备后查。
首先是下载与安装
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server
安装过程中间会出现选择y/n的,直接输入y即可,如下:
[root@APP1 /]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
--2017-10-21 22:59:14-- http://dev.mysql.com/get/mysql-community-release-el7-5.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/mysql-community-release-el7-5.noarch.rpm [following]
--2017-10-21 22:59:14-- https://dev.mysql.com/get/mysql-community-release-el7-5.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//mysql-community-release-el7-5.noarch.rpm [following]
--2017-10-21 22:59:16-- https://repo.mysql.com//mysql-community-release-el7-5.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.219.33.198
Connecting to repo.mysql.com (repo.mysql.com)|23.219.33.198|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6140 (6.0K) [application/x-redhat-package-manager] Saving to: 鈓ysql-community-release-el7-5.noarch.rpm?
100%[================================================================
====================================>] 6,140 --.-K/s in 0s
2017-10-21 22:59:16 (761 MB/s) - 鈓ysql-community-release-el7-5.noarch.rpm?saved [6140/6140]
[root@APP1 /]# rpm -ivh mysql-community-release-el7-5.noarch.rpm Preparing... ################################# [100%] Updating / installing...
1:mysql-community-release-el7-5 ################################# [100%]
[root@APP1 /]# yum install mysql-community-server Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql56-community | 2.5 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/7): base/7/x86_64/group_gz | 156 kB 00:00:00
(2/7): extras/7/x86_64/primary_db | 110 kB 00:00:00
(3/7): mysql-connectors-community/x86_64/primary_db | 16 kB 00:00:03
(4/7): mysql-tools-community/x86_64/primary_db | 35 kB 00:00:03
(5/7): updates/7/x86_64/primary_db | 2.9 MB 00:00:03
(6/7): base/7/x86_64/primary_db | 5.7 MB 00:00:08
(7/7): mysql56-community/x86_64/primary_db | 179 kB 00:00:23 Determining fastest mirrors * base: mirrors.btte.net * extras: mirrors.163.com * updates: mirrors.sohu.com Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.38-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.38-2.el7 for package: mysql-community-server-5.6.38-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.38-2.el7.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.38-2.el7.x86_64 --> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.38-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.38-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.38-2.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64 --> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.35-3.el7 will be obsoleted ---> Package mysql-community-libs.x86_64 0:5.6.38-2.el7 will be obsoleting
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed --> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch --> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed --> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed --> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================
Installing:
mysql-community-libs x86_64 5.6.38-2.el7 mysql56-community 2.0 M
replacing mariadb-libs.x86_64 1:5.5.35-3.el7
mysql-community-server x86_64 5.6.38-2.el7 mysql56-community 59 M
Installing for dependencies:
mysql-community-client x86_64 5.6.38-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.38-2.el7 mysql56-community 257 k
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
Transaction Summary
==============================================================================================================================================
Install 2 Packages (+8 Dependent packages)
Total download size: 82 M Is this ok [y/d/N]: y Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.38-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.6.38-2.el7.x86_64.rpm is not installed
(1/10): mysql-community-common-5.6.38-2.el7.x86_64.rpm | 257 kB 00:00:32
mysql-community-libs-5.6.38-2.
FAILED ] 28 kB/s | 10 MB 00:44:43 ETA
http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-libs-5.6.38-2.el7.x86_64.rpm: [Errno 12] Timeout on http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/mysql-community-libs-5.6.38-2.el7.x86_64.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') Trying other mirror.
CentOS7 下的mysql安装与配置



