CentOS下MySQL官方的 Yum Repository 安装MySQL5.7 community

[root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
--2019-07-22 19:39:43--  http://dev.mysql.com/get/mysql57-community-release-el7-10.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-10.noarch.rpm [following]
--2019-07-22 19:39:43--  https://dev.mysql.com/get/mysql57-community-release-el7-10.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-10.noarch.rpm [following]
--2019-07-22 19:39:45--  https://repo.mysql.com//mysql57-community-release-el7-10.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 104.75.165.42
Connecting to repo.mysql.com (repo.mysql.com)|104.75.165.42|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25548 (25K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-10.noarch.rpm’

100%[==============================================================================================================================>] 25,548      22.4KB/s   in 1.1s

2019-07-22 19:39:48 (22.4 KB/s) - ‘mysql57-community-release-el7-10.noarch.rpm’ saved [25548/25548]

-c: No such file or directory
No URLs found in -c.
FINISHED --2019-07-22 19:39:48--
Total wall clock time: 5.3s
Downloaded: 1 files, 25K in 1.1s (22.4 KB/s)
[root@localhost ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  initial-setup-ks.cfg  Music  mysql57-community-release-el7-10.noarch.rpm  Pictures  Public  Templates  Videos
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 21080.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 114 M RSS (531 MB VSZ)
    Started: Mon Jul 22 19:36:30 2019 - 03:34 ago
    State  : Sleeping, pid: 21080
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 114 M RSS (531 MB VSZ)
    Started: Mon Jul 22 19:36:30 2019 - 03:36 ago
    State  : Sleeping, pid: 21080
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 114 M RSS (531 MB VSZ)
    Started: Mon Jul 22 19:36:30 2019 - 03:38 ago
    State  : Sleeping, pid: 21080
^C

Exiting on user cancel.
[root@localhost ~]# kill -9 21080
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
BDB2053 Freeing read locks for locker 0x26e: 21080/140259928299328
BDB2053 Freeing read locks for locker 0x270: 21080/140259928299328
Loaded plugins: fastestmirror, langpacks
Examining mysql57-community-release-el7-10.noarch.rpm: mysql57-community-release-el7-10.noarch
Marking mysql57-community-release-el7-10.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-10 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                       Arch                       Version                    Repository                                                    Size
========================================================================================================================================================================
Installing:
 mysql57-community-release                     noarch                     el7-10                     /mysql57-community-release-el7-10.noarch                      30 k

Transaction Summary
========================================================================================================================================================================
Install  1 Package

Total size: 30 k
Installed size: 30 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql57-community-release-el7-10.noarch                                                                                                              1/1
  Verifying  : mysql57-community-release-el7-10.noarch                                                                                                              1/1

Installed:
  mysql57-community-release.noarch 0:el7-10

Complete!
[root@localhost ~]# yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirror.jdcloud.com
 * updates: mirror.jdcloud.com
mysql-connectors-community                                                                                                                       | 2.5 kB  00:00:00
mysql-tools-community                                                                                                                            | 2.5 kB  00:00:00
mysql57-community                                                                                                                                | 2.5 kB  00:00:00
(1/3): mysql-connectors-community/x86_64/primary_db                                                                                              |  44 kB  00:00:00
(2/3): mysql-tools-community/x86_64/primary_db                                                                                                   |  61 kB  00:00:00
(3/3): mysql57-community/x86_64/primary_db                                                                                                       | 184 kB  00:00:02
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.27-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.27-1.el7 for package: mysql-community-server-5.7.27-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.27-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.27-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.27-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.27-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.27-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.27-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                            Arch                          Version                                Repository                                Size
========================================================================================================================================================================
Installing:
 mysql-community-libs                               x86_64                        5.7.27-1.el7                           mysql57-community                        2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.60-1.el7_5
 mysql-community-libs-compat                        x86_64                        5.7.27-1.el7                           mysql57-community                        2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.60-1.el7_5
 mysql-community-server                             x86_64                        5.7.27-1.el7                           mysql57-community                        165 M
Installing for dependencies:
 mysql-community-client                             x86_64                        5.7.27-1.el7                           mysql57-community                         24 M
 mysql-community-common                             x86_64                        5.7.27-1.el7                           mysql57-community                        275 k

Transaction Summary
========================================================================================================================================================================
Install  3 Packages (+2 Dependent packages)

Total download size: 194 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.27-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY:-- ETA
Public key for mysql-community-common-5.7.27-1.el7.x86_64.rpm is not installed
(1/5): mysql-community-common-5.7.27-1.el7.x86_64.rpm                                                                                            | 275 kB  00:00:01
(2/5): mysql-community-libs-5.7.27-1.el7.x86_64.rpm                                                                                              | 2.2 MB  00:00:01
(3/5): mysql-community-libs-compat-5.7.27-1.el7.x86_64.rpm                                                                                       | 2.0 MB  00:00:00
(4/5): mysql-community-client-5.7.27-1.el7.x86_64.rpm                                                                                            |  24 MB  00:00:19
(5/5): mysql-community-server-5.7.27-1.el7.x86_64.rpm                                                                                            | 165 MB  00:00:30
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   5.8 MB/s | 194 MB  00:00:33
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-10.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-community-common-5.7.27-1.el7.x86_64                                                                                                           1/6
  Installing : mysql-community-libs-5.7.27-1.el7.x86_64                                                                                                             2/6
  Installing : mysql-community-client-5.7.27-1.el7.x86_64                                                                                                           3/6
  Installing : mysql-community-server-5.7.27-1.el7.x86_64                                                                                                           4/6
  Installing : mysql-community-libs-compat-5.7.27-1.el7.x86_64                                                                                                      5/6
  Erasing    : 1:mariadb-libs-5.5.60-1.el7_5.x86_64                                                                                                                 6/6
  Verifying  : mysql-community-libs-compat-5.7.27-1.el7.x86_64                                                                                                      1/6
  Verifying  : mysql-community-common-5.7.27-1.el7.x86_64                                                                                                           2/6
  Verifying  : mysql-community-server-5.7.27-1.el7.x86_64                                                                                                           3/6
  Verifying  : mysql-community-client-5.7.27-1.el7.x86_64                                                                                                           4/6
  Verifying  : mysql-community-libs-5.7.27-1.el7.x86_64                                                                                                             5/6
  Verifying  : 1:mariadb-libs-5.5.60-1.el7_5.x86_64                                                                                                                 6/6

Installed:
  mysql-community-libs.x86_64 0:5.7.27-1.el7          mysql-community-libs-compat.x86_64 0:5.7.27-1.el7          mysql-community-server.x86_64 0:5.7.27-1.el7

Dependency Installed:
  mysql-community-client.x86_64 0:5.7.27-1.el7                                       mysql-community-common.x86_64 0:5.7.27-1.el7

Replaced:
  mariadb-libs.x86_64 1:5.5.60-1.el7_5

Complete!
[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 Mon 2019-07-22 19:43:00 CST; 3s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 21664 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 21578 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 21667 (mysqld)
    Tasks: 27
   CGroup: /system.slice/mysqld.service
           mq21667 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jul 22 19:42:53 localhost systemd[1]: Starting MySQL Server...
Jul 22 19:43:00 localhost systemd[1]: Started MySQL Server.
[root@localhost ~]# grep "password" /var/log/mysqld.log
2019-07-22T11:42:56.425538Z 1 [Note] A temporary password is generated for root@localhost: ws8EN.Xrj%!k
[root@localhost ~]#  mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值