在centos6中用yum安装mysql失败解决办法

1、用yum安装mysql-server的时候报错

[test@alps yum.repos.d]$ sudo yum install -y mysql-server 
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.scalabledns.com
 * elrepo: repos.lax-noc.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.scalabledns.com
 * updates: mirror.hmc.edu
Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-communit
y-server-5.6.42-2.el7.x86_64 insteadResolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.42-2.el7 for package: mysql-c
ommunity-server-5.6.42-2.el7.x86_64--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-commun
ity-server-5.6.42-2.el7.x86_64--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: perl(warnings) for package: mysql-community-server-5.6.42-2.el7.x8
6_64--> Processing Dependency: perl(strict) for package: mysql-community-server-5.6.42-2.el7.x86_
64--> Processing Dependency: perl(if) for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: perl(Sys::Hostname) for package: mysql-community-server-5.6.42-2.e
l7.x86_64--> Processing Dependency: perl(POSIX) for package: mysql-community-server-5.6.42-2.el7.x86_6
4--> Processing Dependency: perl(Getopt::Long) for package: mysql-community-server-5.6.42-2.el
7.x86_64--> Processing Dependency: perl(File::Temp) for package: mysql-community-server-5.6.42-2.el7.
x86_64--> Processing Dependency: perl(File::Spec) for package: mysql-community-server-5.6.42-2.el7.
x86_64--> Processing Dependency: perl(File::Path) for package: mysql-community-server-5.6.42-2.el7.
x86_64--> Processing Dependency: perl(File::Copy) for package: mysql-community-server-5.6.42-2.el7.
x86_64--> Processing Dependency: perl(File::Basename) for package: mysql-community-server-5.6.42-2.
el7.x86_64--> Processing Dependency: perl(Fcntl) for package: mysql-community-server-5.6.42-2.el7.x86_6
4--> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.42-2.el
7.x86_64--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community
-server-5.6.42-2.el7.x86_64--> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-serv
er-5.6.42-2.el7.x86_64--> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-serv
er-5.6.42-2.el7.x86_64--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5
.6.42-2.el7.x86_64--> Processing Dependency: /usr/bin/perl for package: mysql-community-server-5.6.42-2.el7.x86
_64--> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.6.42-2
.el7.x86_64--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-communit
y-client-5.6.42-2.el7.x86_64--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-client-5
.6.42-2.el7.x86_64---> Package mysql-community-common.x86_64 0:5.6.42-2.el7 will be installed
---> Package mysql-community-server.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community
-server-5.6.42-2.el7.x86_64--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5
.6.42-2.el7.x86_64---> Package numactl.x86_64 0:2.0.9-2.el6 will be installed
---> Package perl.x86_64 4:5.10.1-144.el6 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-144.el6 for package: 4:perl-5.10.1-144.el6.x8
6_64--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-144.el6.x86_64
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-client-5
.6.42-2.el7.x86_64---> Package mysql-community-libs.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-libs-5.6
.42-2.el7.x86_64---> Package mysql-community-server.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community
-server-5.6.42-2.el7.x86_64--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5
.6.42-2.el7.x86_64---> Package perl-Module-Pluggable.x86_64 1:3.90-144.el6 will be installed
---> Package perl-Pod-Simple.x86_64 1:3.13-144.el6 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-144
.el6.x86_64---> Package perl-libs.x86_64 4:5.10.1-144.el6 will be installed
---> Package perl-version.x86_64 3:0.77-144.el6 will be installed
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-client-5
.6.42-2.el7.x86_64---> Package mysql-community-libs.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-libs-5.6
.42-2.el7.x86_64---> Package mysql-community-server.x86_64 0:5.6.42-2.el7 will be installed
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.6.42-2.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community
-server-5.6.42-2.el7.x86_64--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5
.6.42-2.el7.x86_64---> Package perl-Pod-Escapes.x86_64 1:1.04-144.el6 will be installed
--> Finished Dependency Resolution
Error: Package: mysql-community-server-5.6.42-2.el7.x86_64 (mysql56-community)
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-server-5.6.42-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.42-2.el7.x86_64 (mysql56-community)
           Requires: systemd
Error: Package: mysql-community-libs-5.6.42-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-client-5.6.42-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

 

2、解决办法:

1)进到/etc/yum.repos.d目录编辑mysql-community.repo 文件,将enabled设置为0,如下面。

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[test@alps yum.repos.d]$ sudo vi mysql-community.repo 

2)保存重新安装即可。
[test@alps yum.repos.d]$ sudo yum install mysql-server


Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.scalabledns.com
 * elrepo: repos.lax-noc.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.scalabledns.com
 * updates: mirror.hmc.edu
mysql-connectors-community                                            | 2.5 kB     00:00     
mysql-tools-community                                                 | 2.5 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.1.73-8.el6_8 will be installed
--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-server-5.1.73-8.el6_8.x8
6_64--> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(vars) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(strict) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(Sys::Hostname) for package: mysql-server-5.1.73-8.el6_8.x86_6
4--> Processing Dependency: perl(POSIX) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(File::Temp) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(File::Path) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(File::Copy) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(File::Basename) for package: mysql-server-5.1.73-8.el6_8.x86_
64--> Processing Dependency: perl(Data::Dumper) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysq
l-server-5.1.73-8.el6_8.x86_64--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-
server-5.1.73-8.el6_8.x86_64--> Processing Dependency: /usr/bin/perl for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-server-5.1.73-8
.el6_8.x86_64--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-server-5.1.73-8.e
l6_8.x86_64--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be installed
---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be installed
---> Package perl.x86_64 4:5.10.1-144.el6 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-144.el6 for package: 4:perl-5.10.1-144.el6.x8
6_64--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-144.el6.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-144.el6.x86_64
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package perl-Module-Pluggable.x86_64 1:3.90-144.el6 will be installed
---> Package perl-Pod-Simple.x86_64 1:3.13-144.el6 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-144
.el6.x86_64---> Package perl-libs.x86_64 4:5.10.1-144.el6 will be installed
---> Package perl-version.x86_64 3:0.77-144.el6 will be installed
--> Running transaction check
---> Package perl-Pod-Escapes.x86_64 1:1.04-144.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================
 Package                       Arch           Version                     Repository    Size
=============================================================================================
Installing:
 mysql-server                  x86_64         5.1.73-8.el6_8              base         8.6 M
Installing for dependencies:
 mysql                         x86_64         5.1.73-8.el6_8              base         895 k
 mysql-libs                    x86_64         5.1.73-8.el6_8              base         1.2 M
 perl                          x86_64         4:5.10.1-144.el6            base          10 M
 perl-DBD-MySQL                x86_64         4.013-3.el6                 base         134 k
 perl-DBI                      x86_64         1.609-4.el6                 base         705 k
 perl-Module-Pluggable         x86_64         1:3.90-144.el6              base          41 k
 perl-Pod-Escapes              x86_64         1:1.04-144.el6              base          33 k
 perl-Pod-Simple               x86_64         1:3.13-144.el6              base         213 k
 perl-libs                     x86_64         4:5.10.1-144.el6            base         579 k
 perl-version                  x86_64         3:0.77-144.el6              base          52 k

Transaction Summary
=============================================================================================
Install      11 Package(s)

Total download size: 23 M
Installed size: 69 M
Is this ok [y/N]: y
Downloading Packages:
(1/11): mysql-5.1.73-8.el6_8.x86_64.rpm                               | 895 kB     00:00     
(2/11): mysql-libs-5.1.73-8.el6_8.x86_64.rpm                          | 1.2 MB     00:00     
(3/11): mysql-server-5.1.73-8.el6_8.x86_64.rpm                        | 8.6 MB     00:01     
(4/11): perl-5.10.1-144.el6.x86_64.rpm                                |  10 MB     00:01     
(5/11): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm                         | 134 kB     00:00     
(6/11): perl-DBI-1.609-4.el6.x86_64.rpm                               | 705 kB     00:00     
(7/11): perl-Module-Pluggable-3.90-144.el6.x86_64.rpm                 |  41 kB     00:00     
(8/11): perl-Pod-Escapes-1.04-144.el6.x86_64.rpm                      |  33 kB     00:00     
(9/11): perl-Pod-Simple-3.13-144.el6.x86_64.rpm                       | 213 kB     00:00     
(10/11): perl-libs-5.10.1-144.el6.x86_64.rpm                          | 579 kB     00:00     
(11/11): perl-version-0.77-144.el6.x86_64.rpm                         |  52 kB     00:00     
---------------------------------------------------------------------------------------------
Total                                                        7.1 MB/s |  23 MB     00:03     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-libs-5.1.73-8.el6_8.x86_64                                         1/11 
  Installing : 1:perl-Pod-Escapes-1.04-144.el6.x86_64                                   2/11 
  Installing : 4:perl-libs-5.10.1-144.el6.x86_64                                        3/11 
  Installing : 1:perl-Module-Pluggable-3.90-144.el6.x86_64                              4/11 
  Installing : 1:perl-Pod-Simple-3.13-144.el6.x86_64                                    5/11 
  Installing : 3:perl-version-0.77-144.el6.x86_64                                       6/11 
  Installing : 4:perl-5.10.1-144.el6.x86_64                                             7/11 
  Installing : perl-DBI-1.609-4.el6.x86_64                                              8/11 
  Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                                        9/11 
  Installing : mysql-5.1.73-8.el6_8.x86_64                                             10/11 
  Installing : mysql-server-5.1.73-8.el6_8.x86_64                                      11/11 
  Verifying  : 3:perl-version-0.77-144.el6.x86_64                                       1/11 
  Verifying  : 4:perl-libs-5.10.1-144.el6.x86_64                                        2/11 
  Verifying  : 4:perl-5.10.1-144.el6.x86_64                                             3/11 
  Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                                        4/11 
  Verifying  : mysql-server-5.1.73-8.el6_8.x86_64                                       5/11 
  Verifying  : perl-DBI-1.609-4.el6.x86_64                                              6/11 
  Verifying  : 1:perl-Module-Pluggable-3.90-144.el6.x86_64                              7/11 
  Verifying  : 1:perl-Pod-Simple-3.13-144.el6.x86_64                                    8/11 
  Verifying  : 1:perl-Pod-Escapes-1.04-144.el6.x86_64                                   9/11 
  Verifying  : mysql-5.1.73-8.el6_8.x86_64                                             10/11 
  Verifying  : mysql-libs-5.1.73-8.el6_8.x86_64                                        11/11 

Installed:
  mysql-server.x86_64 0:5.1.73-8.el6_8                                                       

Dependency Installed:
  mysql.x86_64 0:5.1.73-8.el6_8              mysql-libs.x86_64 0:5.1.73-8.el6_8             
  perl.x86_64 4:5.10.1-144.el6               perl-DBD-MySQL.x86_64 0:4.013-3.el6            
  perl-DBI.x86_64 0:1.609-4.el6              perl-Module-Pluggable.x86_64 1:3.90-144.el6    
  perl-Pod-Escapes.x86_64 1:1.04-144.el6     perl-Pod-Simple.x86_64 1:3.13-144.el6          
  perl-libs.x86_64 4:5.10.1-144.el6          perl-version.x86_64 3:0.77-144.el6             

Complete!

你可能感兴趣的:(异常报错)