qmh13759918377
小又的后花园
2019-07-25 00:56
采纳率: 100%
浏览 6.5k

centos6安装mysql5.7出错:yum install mysql-community-server出错

安装mysql5.7,参考教程:https://www.php.cn/mysql-tutorials-386847.html

一开始不知道 地址中的el7应该对应自己的centos版本,直接执行该命令进行下载

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

然后执行以下命令也没有报错,

yum -y localinstall mysql57-community-release-el7-11.noarch.rpm

但是执行下面命令的时候一直报错

yum -y install mysql-community-server

之后重新下载centos6的版本,安装源

# wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
# yum -y localinstall mysql57-community-release-el6-11.noarch.rpm

然而进行安装的时候还是报错

yum -y install mysql-community-server

原因在于他还是跑去安装el7的版本了

---> Package mysql-community-server.i686 0:5.7.17-1.el7 will be 安装

尝试了各种方法,重装了好多次,能删除的就删除,结果一直都是这样

获取mysql-community-server的信息,结果如下:
图片说明

尝试删除无果:

[root@localhost ~]# yum remove mysql-community-server
已加载插件:fastestmirror, security
设置移除进程
参数 mysql-community-server 没有匹配
Loading mirror speeds from cached hostfile
Package(s) mysql-community-server available, but not installed.
不删除任何软件包

真的搞了一天,心累啊!如果哪个好心人看到,可以提点提点,真的万分感谢!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • a672054126
    a672054126 2019-07-25 09:25
    已采纳

    报的什么错呢, 可以参考下https://www.jianshu.com/p/7b8c4dea6829

    点赞 评论
  • dabocaiqq
    dabocaiqq 2019-07-25 10:01
    点赞 评论
  • qq_36720114
    德玛洗牙 2019-07-25 10:40

    不知道你有没有卸载这个mysql57-community-release-el7-11.noarch.rpm

    点赞 评论
  • weixin_45427649
    weixin_45427649 2019-07-25 19:32

    may be you need to try with sudo

    and try to do the get packages command first

    or try this

    Head over here and get the url for yum repo to be deployed in your server: http://dev.mysql.com/downloads/repo/yum/
    Copy the download link:

    Now that you have the download link, wget get the repo rpm and check file checksum to make sure that rpm is downloaded with out errors. Make a note of checksum from first picture above (Checksum validation is optional)

    Enter below codes Kindly replace the Capital letters in first with small eg: Wget is wget

    wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
    md5sum mysql57-community-release-el6-7.noarch.rpm
    rpm -ivh mysql57-community-release-el6-7.noarch.rpm

    yum install -y mysql-community-client mysql-community-server

    service mysqld start

    And find initial mysql 5.7 root password from log file

    grep -i temporary /var/log/mysqld.log

    ogin into MySQL 5.7 using password you got from temporary password that you searched from above

    mysql -uroot -p

    Only command MySQL 5.7 is going to let you run once you login with your default password is password command

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Yourpassword1!');

    That’s it, you have successfully installed MySQL 5.7 server on CentOS 6/Redhat EL6/Fedora. Open some firewall rules if needed and create users to access your database.

    点赞 评论

相关推荐