解决CentOS7下yum install mysql-server没有可用包的问题

Linux就该这么学
[azq@localhost ~]$ sudo yum install mysql-server
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: centos.ustc.edu.cn
没有可用软件包 mysql-server。
错误:无须任何处理
 
 
[plain] view plaincopy在CODE上查看代码片派生到我的代码片

 

  1. # wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm  



--  http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

 

正在解析主机 repo.mysql.com (repo.mysql.com)... 23.4.241.142

正在连接 repo.mysql.com (repo.mysql.com)|23.4.241.142|:80... 已连接。

已发出 HTTP 请求,正在等待回应... 200 OK

长度:6140 (6.0K) [application/x-redhat-package-manager]

正在保存至: “mysql-community-release-el7-5.noarch.rpm”

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

(467 MB/s) - 已保存 “MySQL-community-release-el7-5.noarch.rpm” [6140/6140])

 

[plain] view plaincopy在CODE上查看代码片派生到我的代码片

 

  1. # ls  

 

mysql-community-release-el7-5.noarch.rpm

[plain] view plaincopy在CODE上查看代码片派生到我的代码片

 

  1. # rpm -ivh mysql-community-release-el7-5.noarch.rpm  

准备中...                          ################################# [100%]

正在升级/安装...

1:mysql-community-release-el7-5    ################################# [100%]

ps:如果出现can't create transaction lock on /var/lib/rpm/.rpm.lock 错误

错误原因:权限问题
解决方法:在终端输入“su”和密码,登录root,以root身份登录就不会有提示

 

[plain] view plaincopy在CODE上查看代码片派生到我的代码片

 

  1. # ls -1 /etc/yum.repos.d/mysql-community*  

/etc/yum.repos.d/mysql-community.repo

 

/etc/yum.repos.d/mysql-community-source.repo

 

[plain] view plaincopy在CODE上查看代码片派生到我的代码片

 

  1. # yum install mysql-server  
  2.  
 

本文由 CentOS中文站 - 专注Linux技术 作者:centos 发表,其版权均为 CentOS中文站 - 专注Linux技术 所有,文章内容系作者个人观点,不代表 CentOS中文站 - 专注Linux技术 对观点赞同或支持。如需转载,请注明文章来源。

相关文章

发表评论

邮箱地址不会被公开。 必填项已用*标注