qq_30558451 2024-09-02 16:29 采纳率: 0%
浏览 35
已结题

centos7下载mysql提示DNS解析异常

#####问题背景:windows上装多台虚拟机,来测试mycat,其中一台虚拟机装mysql的时候遇到如下问题,上传的centos7的镜像

#####具体错误日志:

"[root@localhost centosroot]# sudo yum -y localinstall mysql-community-client-5.7.30-1.el7.x86_64.rpm
已加载插件:fastestmirror
正在检查 mysql-community-client-5.7.30-1.el7.x86_64.rpm: mysql-community-client-5.7.30-1.el7.x86_64
mysql-community-client-5.7.30-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-client.x86_64.0.5.7.30-1.el7 将被 安装
--> 正在处理依赖关系 mysql-community-libs(x86-64) >= 5.7.9,它被软件包 mysql-community-client-5.7.30-1.el7.x86_64 需要
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64"

虚拟机网络配置以及本机网络配置

本地的机子ip配置:
连接特定的 DNS 后缀 . . . . . . . :
IPv6 地址 . . . . . . . . . . . . : 240e:47d:32e8:909c:dc1b:f63e:b065:553c
临时 IPv6 地址. . . . . . . . . . : 240e:47d:32e8:909c:a5c3:a7ad:741:cea4
本地链接 IPv6 地址. . . . . . . . : fe80::dc1b:f63e:b065:553c%48
IPv4 地址 . . . . . . . . . . . . : 192.168.43.64
子网掩码 . . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . : fe80::74df:40ff:fe34:7225%48
192.168.43.1
虚拟机网络配置:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:8b:0c:61 brd ff:ff:ff:ff:ff:ff
inet 192.168.43.66/24 brd 192.168.43.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 240e:47d:32e8:909c:20c:29ff:fe8b:c61/64 scope global mngtmpaddr dynamic
valid_lft 3541sec preferred_lft 3541sec
inet6 fe80::20c:29ff:fe8b:c61/64 scope link
valid_lft forever preferred_lft forever

虚拟机的resolv.conf文件配置:
nameserver 1.1.1.1
nameserver 1.0.0.1

虚拟机的ifcfg-ens33文件配置:

"E=ens33
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.43.66
NETMASK=255.255.255.0
GATEWAY=192.168.43.1
DNS1=1.1.1.1
DNS2=1.0.0.1"




采用的桥接模式

我想要达到的结果

在这台虚拟机成功使用mysql以便测试mycat

  • 写回答

28条回答 默认 最新

  • 专家-赤兔[在线] 全栈领域优质创作者 2024-09-02 16:29
    关注

    以下回复引自免费微信小程序:皆我百晓生。 如问题解决,还请采纳。如仍有疑问,请回复留言或私信博主,以便获得更精准的帮助。

    1. 检查MYSQL版本是否正确安装:检查MYSQL服务器是否已经正确安装并启动。
    2. 检查网络连接是否正常:确保你的电脑和MYSQL服务之间有稳定的网络连接。
    3. 使用DNS服务器:如果使用的是DNS服务器进行DNS查询,需要确保DNS服务器设置正确,并且在CENTOS 7中可用。
    4. 重启MYSQL服务:如果上述步骤都不能解决问题,可能是由于某些原因导致的错误。尝试重新启动MYSQL服务或检查是否有其他服务正在运行,或者检查磁盘空间是否足够。
    5. 更新MYSQL软件包:如果你发现是某个特定版本的问题,可能需要更新这个版本。
    6. 使用其他数据库:如果以上步骤都无法解决问题,可以考虑使用其他数据库系统,例如POSTGRESQL、ORACLE或其他支持MYSQL的数据库。
    7. 如果以上方法都无效,可能需要联系技术支持寻求帮助。
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 9月7日
  • 创建了问题 9月2日

悬赏问题

  • ¥15 绘制饼图及环形图(饼图和环形图示)
  • ¥15 求一套完整的纵横四海程序。
  • ¥15 python编写ros控制乌龟移动报错,如何解决?
  • ¥20 AD7606采集到电压乱飘,怎么解决呢
  • ¥60 有没有人查监控方面厉害的呢
  • ¥15 绑住完成C语言的任务
  • ¥20 vue项目打包Android apk,实现小说文本朗读功能
  • ¥50 IPv6网络,br-lan拿不到地址无法全局路由
  • ¥15 微信小程序分页查询如何设置下一页
  • ¥15 树莓派Linux系统下无法下载miniconda