liunx安装MySQL 报错误(错误:依赖检测失败:mysql-community-common(x86-64) >= 5.7.9 被 mysql-community-libs-5.7.离线安装)

今天安装MySQL(离线)的时候,发现安着安着,就出问题了,在网上找了解决方法,所以分享一下给大家

报错内容

我是在把压缩包放到liunx 之后,解压,往下操作的时候出的错

[root@localhost mysql]# tar -xvf mysql-5.7.30-1.el7.x86_64.rpm-bundle.tar
mysql-community-common-5.7.30-1.el7.x86_64.rpm
mysql-community-server-5.7.30-1.el7.x86_64.rpm
mysql-community-test-5.7.30-1.el7.x86_64.rpm
mysql-community-client-5.7.30-1.el7.x86_64.rpm
mysql-community-embedded-5.7.30-1.el7.x86_64.rpm
mysql-community-libs-5.7.30-1.el7.x86_64.rpm
mysql-community-devel-5.7.30-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.30-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.30-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.30-1.el7.x86_64.rpm

安装

rpm -ivh mysql-community-common-5.7.23-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.23-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.23-1.el7.x86_64.rpm

//安装之前,请先检查是否安装libaio,如果未安装请先安装之后再装server源
rpm -qa|grep libaio

rpm -ivh mysql-community-server-5.7.23-1.el7.x86_64.rpm

因为这是我在不同的虚拟机里面安装MySQL,所以执行顺序要发生了改变,因为这些包有依赖顺序,而且版本有先后

rpm -ivh mysql-community-server-5.7.30-1.el7.x86_64.rpm --force --nodeps


rpm -ivh mysql-community-common-5.7.30-1.el7.x86_64.rpm --force --nodeps


rpm -ivh mysql-community-libs-5.7.30-1.el7.x86_64.rpm --force --nodeps


rpm -ivh mysql-community-client-5.7.30-1.el7.x86_64.rpm --force --nodeps

systemctl start mysqld // 启动

systemctl status mysqld // 查看状态

查看临时密码:

 grep password /var/log/mysqld.log

例如我这个的临时密码就是  hhrcu5nV-A(z

然后使用 mysql -u root -p 回车 输入临时密码

 进入之后分别使用

set global validate_password_policy=0;

set global validate_password_length=1;

alter user 'root'@'localhost' identified by '123456';

 开启远程连接

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

  1. firewall-cmd --zone=public --query-port=3306/tcp

  2. firewall-cmd --zone=public --add-port=3306/tcp --permanent
  3. firewall-cmd --reload
  4. firewall-cmd --zone=public --query-port=3306/tcp

然后查看mysql是否启动成功

systemctl status mysqld

 然后测试连接 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值