安装虚拟机和数据库部分报错解决(CentOS7)

安装虚拟机和数据库部分报错解决(CentOS7)

Mysql:1251- Client does not support authentication protocol requested by server…的问题
解决办法:
ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘123456’; #更新user为root,host为% 的密码为123456
或者
ALTER USER ‘root’@‘%’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER; #修改加密规则
ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘password’; #更新一下用户的密码
FLUSH PRIVILEGES; #刷新权限

安装数据库:
错误:依赖检测失败:
/usr/bin/perl 被 mysql-community-server-xxxxxxx.x86_64 需要
perl(Getopt::Long) 被 mysql-community-xxxxxxx.x86_64 需要
perl(strict) 被 mysql-community-server-xxxxxxx.x86_64 需要

解决:
yum install net-tools

yum install -y perl-Module-Install.noarch

yum install -y perl-Module-Install.noarch
报错:Error downloading packages:

glibc-common-xxxxxxx.x86_64: [Errno 256] No more mirrors to try.
解决办法:
cd /etc/yum.repos.d/

rm -rf *.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache

远程授权:
ERROR 1410 (42000): You are not allowed to create a user with GRANT

解决办法:
update user set host=‘%’ where user=‘root’;

ERROR 1396 (HY000): Operation CREATE USER failed for ‘root’@’%’
解决办法:
drop user root@‘%’;#删除用户

flush privileges;#刷新权限
再次创建

远程连接数据库:
2003-Can’t connect to MySql server on ‘localhost’(10038)

解决办法:查看数据库状态
systemctl status mysql #查看数据库状态

systemctl restart mysql #重启数据库

查看防火墙是否关闭,没有关闭,直接关闭防火墙
systemctl stop firewalld
关闭 ‘开机重启防火墙’
systemctl disabled firewalld

Linux:finalshell 连接主机java.net.ConnectException: Connection timed out: connect
解决:
systemctl stop firewalld #关闭防火墙,systemctl stop NetworkManager

IP地址前三位与网关地址前三位保持相同 如:192.168.109.xxx 192.168.109.xxx(搭建虚拟机时更改过IP,改回IP地址前三位与网关地址前三位保持相同后就能连接了)

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ChlinRei

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值