linux安装mysql报错

第一种

l-devel
已加载插件:fastestmirror, security
设置安装进程
Loading mirror speeds from cached hostfile
No package mysql available.
No package mysql-server available.
No package mysql-devel available.
错误:无须任何处理
[root@node01 init.d]# find -name mysql
[root@node01 init.d]# yum install -y mysql
已加载插件:fastestmirror, security
设置安装进程
Loading mirror speeds from cached hostfile
No package mysql available.
错误:无须任何处理
[root@node01 init.d]#  wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2020-12-18 08:46:55--  http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
正在解析主机 repo.mysql.com... 184.26.84.248
正在连接 repo.mysql.com|184.26.84.248|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm”

100%[===================>] 6,140       --.-K/s   in 0s      

2020-12-18 08:46:56 (843 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rpm” [6140/6140])

[root@node01 init.d]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
Preparing...                                                 ########################################### [100%]
   1:mysql-community-release                                 ########################################### [100%]
[root@node01 init.d]# yum  install  mysql  mysql-server  mysql-devel
已加载插件:fastestmirror, security
设置安装进程
Loading mirror speeds from cached hostfile
mysql-connectors-community            | 2.6 kB     00:00     
mysql-connectors-community/primary_db |  68 kB     00:00     
mysql-tools-community                 | 2.6 kB     00:00     
mysql-tools-community/primary_db      |  83 kB     00:00     
mysql56-community                     | 2.6 kB     00:00     
mysql56-community/primary_db          | 288 kB     00:00     
解决依赖关系
--> 执行事务检查
---> Package mysql-community-client.x86_64 0:5.6.50-2.el7 will be 安装
--> 处理依赖关系 mysql-community-libs(x86-64) >= 5.6.10,它被软件包 mysql-community-client-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 libc.so.6(GLIBC_2.17)(64bit),它被软件包 mysql-community-client-5.6.50-2.el7.x86_64 需要
---> Package mysql-community-devel.x86_64 0:5.6.50-2.el7 will be 安装
---> Package mysql-community-server.x86_64 0:5.6.50-2.el7 will be 安装
--> 处理依赖关系 mysql-community-common(x86-64) = 5.6.50-2.el7,它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 libstdc++.so.6(GLIBCXX_3.4.15)(64bit),它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 systemd,它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 systemd,它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 libc.so.6(GLIBC_2.17)(64bit),它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 执行事务检查
---> Package mysql-community-client.x86_64 0:5.6.50-2.el7 will be 安装
--> 处理依赖关系 libc.so.6(GLIBC_2.17)(64bit),它被软件包 mysql-community-client-5.6.50-2.el7.x86_64 需要
---> Package mysql-community-common.x86_64 0:5.6.50-2.el7 will be 安装
---> Package mysql-community-libs.x86_64 0:5.6.50-2.el7 will be obsoleting
--> 处理依赖关系 libc.so.6(GLIBC_2.17)(64bit),它被软件包 mysql-community-libs-5.6.50-2.el7.x86_64 需要
---> Package mysql-community-server.x86_64 0:5.6.50-2.el7 will be 安装
--> 处理依赖关系 libstdc++.so.6(GLIBCXX_3.4.15)(64bit),它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 systemd,它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 systemd,它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
--> 处理依赖关系 libc.so.6(GLIBC_2.17)(64bit),它被软件包 mysql-community-server-5.6.50-2.el7.x86_64 需要
---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be 取代
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 2:postfix-2.6.6-8.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 2:postfix-2.6.6-8.el6.x86_64 需要
--> 完成依赖关系计算
错误:Package: mysql-community-server-5.6.50-2.el7.x86_64 (mysql56-community)
          Requires: libc.so.6(GLIBC_2.17)(64bit)
错误:Package: 2:postfix-2.6.6-8.el6.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
          Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
          正在删除: mysql-libs-5.1.73-8.el6_8.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
              libmysqlclient.so.16(libmysqlclient_16)(64bit)
          Obsoleted By: mysql-community-libs-5.6.50-2.el7.x86_64 (mysql56-community)
              Not found
错误:Package: mysql-community-server-5.6.50-2.el7.x86_64 (mysql56-community)
          Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
错误:Package: mysql-community-server-5.6.50-2.el7.x86_64 (mysql56-community)
          Requires: systemd
错误:Package: 2:postfix-2.6.6-8.el6.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
          Requires: libmysqlclient.so.16()(64bit)
          正在删除: mysql-libs-5.1.73-8.el6_8.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
              libmysqlclient.so.16()(64bit)
          Obsoleted By: mysql-community-libs-5.6.50-2.el7.x86_64 (mysql56-community)
              Not found
错误:Package: mysql-community-client-5.6.50-2.el7.x86_64 (mysql56-community)
          Requires: libc.so.6(GLIBC_2.17)(64bit)
错误:Package: mysql-community-libs-5.6.50-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
[root@node01 init.d]# yum -y remove mariadb-libs
已加载插件:fastestmirror, security
设置移除进程
参数 mariadb-libs 没有匹配
Loading mirror speeds from cached hostfile
不删除任何软件包

基本确定是因为 mysql 的依赖问题;由于对本来说,最快的解决方案就是卸载重装.

卸载

1.快速删除

yum remove  mysql mysql-server mysql-libs mysql-server
```
2.查找残留文件
```
rpm -qa | grep -i mysql
```
将查询出来的文件逐个删除,
```
yum remove mysql-community-release-el7-5.noarch
```
4.查找残留目录
```
whereis mysql
```
逐条删除目录,如:
```
rm –rf /usr/lib64/mysql
```

转载:https://www.jianshu.com/p/7b8c4dea6829


### 第二种错误
```
No package mysql available.
No package mysql-server available.
No package mysql-devel available.
错误:无须任何处理
```

##### 解决
```
1: wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
 
2: rpm -ivh mysql-community-release-el7-5.noarch.rpm
```
上一篇:CentOS7环境,安装MySQL


下一篇:安装MySQL5.7