CentOS7安装MySQL错误解决:error: Failed dependencies net-tools is needed by

错误一:

错误描述:
[root@HP110 software]# rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm warning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: net-tools is needed by mysql-community-server-5.7.19-1.el7.x86_64


解决方法:

方法一(无网):后面加上 --force --nodeps
方法二(有网):yum install net-tools
如:
[root@HP110 software]# rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm --force --nodeps
warning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:mysql-community-server-5.7.19-1.e################################# [100%]


错误解析:

1.–nodeps就是安装时不检查依赖关系,比如你这个rpm需要A,但是你没装A,这样你的包就装不上,用了–nodeps你就能装上了。

2.–force就是强制安装,比如你装过这个rpm的版本1,如果你想装这个rpm的版本2,就需要用–force强制安装。

3.net-tools,Linux的基本网络实用程序集合,mysql的依赖。


错误二:

错误描述:ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password:yes)

解决方法:

1、停止mysql服务:systemctl stop mysqld.service
2、修改配置文件无密码登录
vi /etc/my.cnf
在最尾部加上skip-grant-tables 这是表示没有密码可登录,授权跳跃。
保存
3、启动mysql:systemctl start mysqld.service
4、登录musql:mysql -u root
此处注意不要加-p
5、登录后修改密码:alter user ‘root’@‘localhost’ identified by ‘想修改的密码’;
6、回到第二步骤去掉加上的
skip-grant-tables
保存 重启mysql服务就ok了

注意:
登录后修改MySQL密码:alter user ‘root’@‘localhost’ identified by ‘修改的密码’;
mysql> alter user ‘root’@‘localhost’ identified by ‘root’;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
错误1819 (HY000):您的密码不满足当前的策略要求,密码设置过小
此时需要修改级别与最小的默认密码位数
set global validate_password_policy=0; 因密码过于简单,调整MySQL密码验证规则
set global validate_password_length=4; 密码长度限制 ,这个值最小要是4
然后再进行设置密码就好了

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值