LINUX79 MYSQL

发布于:2025-07-12 ⋅ 阅读:(21) ⋅ 点赞:(0)

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, ‘Resolving timed out after 95598 milliseconds’)
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
在这里插入图片描述

[root@centos7 yum.repos.d]# ntpdate 120.25.108.11
9 Jul 00:35:35 ntpdate[17012]: no server suitable for synchronization found
在这里插入图片描述
在这里插入图片描述

root@192.168.235.130's password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to root@192.168.235.130                              │
     │   • SSH compression : ✘                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✘  (disabled or not supported by server)     │
     │   • DISPLAY         : 192.168.1.171:0.0                            │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Tue Jul  8 22:59:51 2025
[root@centos7 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                                                                                                                   repo name
local                                                                                                                                     local nam
repolist: 4,070
[root@centos7 ~]# yum install wget -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                                           Arch                                                                Version
===================================================================================================================================================
Installing:
 wget                                                              x86_64                                                              1.14-18.el7_

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 547 k
Installed size: 2.0 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wget-1.14-18.el7_6.1.x86_64
  Verifying  : wget-1.14-18.el7_6.1.x86_64

Installed:
  wget.x86_64 0:1.14-18.el7_6.1

Complete!
[root@centos7 ~]# cd /etc/yum.repos.d
[root@centos7 yum.repos.d]# ls
local.repo  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/centos7_base                                .repo
--2025-07-08 23:37:21--  http://mirrors.cloud.tencent.com/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-07-08 23:37:22 ERROR 404: Not Found.

[root@centos7 yum.repos.d]# ping www.baidu.com
PING www.wshifen.com (103.235.46.115) 56(84) bytes of data.
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=1 ttl=128 time=121 ms
^C
--- www.wshifen.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 121.546/121.546/121.546/0.000 ms
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base,repo
--2025-07-08 23:44:49--  http://mirrors.cloud.tencent.com/repo/centos7_base,repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-07-08 23:44:50 ERROR 404: Not Found.

[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
--2025-07-08 23:45:03--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================>] 1,694       --.-K/s   in 0s

2025-07-08 23:45:03 (47.9 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1694/1694]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras local os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors


^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.c                om/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 186158 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Da                maged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com                /centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 186158 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Dama                ged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.repo  repo.tar.gz
[root@centos7 yum.repos.d]# tar -zcf local.tar.gz local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
extras                                                                                                      | 2.9 kB  00:00:00
os                                                                                                          | 3.6 kB  00:00:00
updates                                                                                                     | 2.9 kB  00:00:00
(1/10): extras/7/x86_64/filelists_db                                                                        | 305 kB  00:00:00
(2/10): extras/7/x86_64/other_db                                                                            | 154 kB  00:00:00
(3/10): os/7/x86_64/filelists_db                                                                            | 7.2 MB  00:00:01
(4/10): os/7/x86_64/primary_db                                                                              | 6.1 MB  00:00:01
(5/10): os/7/x86_64/other_db                                                                                | 2.6 MB  00:00:00
(6/10): updates/7/x86_64/primary_db                                                                         |  27 MB  00:00:05
(7/10): updates/7/x86_64/other_db                                                                           | 1.6 MB  00:00:00
ss
^C

Exiting on user cancel
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.c                om/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 49611 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Da                maged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com                /centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 49611 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Dama                ged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[os]
name=Qcloud centos os - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=Qcloud centos updates - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[centosplus]
name=Qcloud centosplus - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[cr]
name=Qcloud centos cr - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/cr/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[extras]
name=Qcloud centos extras - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[fasttrack]
name=Qcloud centos fasttrack - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# yum cleanall
Loaded plugins: fastestmirror
No such command: cleanall. Please use /usr/bin/yum --help
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 103913 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 103913 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@centos7 yum.repos.d]# wget -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror


File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'--2025-07-09 00:03:30--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo\n'
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror


File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'--2025-07-09 00:03:30--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo\n'
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv: overwrite ‘/etc/yum.repos.d/CentOS-Base.repo.backup’?
[root@centos7 yum.repos.d]# ls
centos7_base.repo  CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# cat  centos7_base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[os]
name=Qcloud centos os - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=Qcloud centos updates - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[centosplus]
name=Qcloud centosplus - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[cr]
name=Qcloud centos cr - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/cr/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[extras]
name=Qcloud centos extras - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[fasttrack]
name=Qcloud centos fasttrack - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# ld
ld: no input files
[root@centos7 yum.repos.d]# ls
centos7_base.repo  CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f centos7_base.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv: overwrite ‘/etc/yum.repos.d/CentOS-Base.repo.backup’? yes
[root@centos7 yum.repos.d]# ls -l
total 12
-rw-r--r--. 1 root root  568 Jul  9 00:03 CentOS-Base.repo.backup
-rw-r--r--. 1 root root  176 Jul  8 23:50 local.tar.gz
-rw-r--r--. 1 root root 2705 Jul  8 23:16 repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
--2025-07-09 00:10:17--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 42.7.49.72, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|42.7.49.72|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 1,694       --.-K/s   in 0s

2025-07-09 00:10:18 (74.8 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1694/1694]

[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95598 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95598 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -rf CentOS-Base.repo
[root@centos7 yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tencent.com/repo/centos7_base.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
^C
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2025-07-09 00:24:33--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 36.249.88.92, 36.250.15.232, 36.250.15.227, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|36.249.88.92|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 2,523       --.-K/s   in 0s

2025-07-09 00:24:33 (127 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
^Chttp://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95270 milliseconds')
Trying other mirror.
^Chttp://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttp://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttp://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base - mirrors.aliyun.com),
 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=base ...

     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 base
        or
            subscription-manager repos --disable=base

     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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95270 milliseconds')
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# vim CentOS-Base.repo
-bash: vim: command not found
[root@centos7 yum.repos.d]# vi CentOS-Base.repo
[root@centos7 yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
^Chttps://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 48354 milliseconds')
Trying other mirror.
^Chttps://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttps://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttps://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base - mirrors.aliyun.com),
 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=base ...

     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 base
        or
            subscription-manager repos --disable=base

     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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 48354 milliseconds')
https://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
https://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f CentOS-Base.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# tar xf local.tar.gz
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: local
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
local                                                                                                                       | 3.6 kB  00:00:00
(1/4): local/group_gz                                                                                                       | 153 kB  00:00:00
(2/4): local/primary_db                                                                                                     | 3.3 MB  00:00:00
(3/4): local/filelists_db                                                                                                   | 3.3 MB  00:00:00
(4/4): local/other_db                                                                                                       | 1.3 MB  00:00:00
Metadata Cache Created
[root@centos7 yum.repos.d]# yum install bash-completion vim net-tools nepdate -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package nepdate available.
Resolving Dependencies
--> Running transaction check
---> Package bash-completion.noarch 1:2.1-8.el7 will be installed
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
---> Package vim-enhanced.x86_64 2:7.4.629-7.el7 will be installed
--> Processing Dependency: vim-common = 2:7.4.629-7.el7 for package: 2:vim-enhanced-7.4.629-7.el7.x86_64
--> Processing Dependency: libgpm.so.2()(64bit) for package: 2:vim-enhanced-7.4.629-7.el7.x86_64
--> Running transaction check
---> Package gpm-libs.x86_64 0:1.20.7-6.el7 will be installed
---> Package vim-common.x86_64 2:7.4.629-7.el7 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.4.629-7.el7.x86_64
--> Running transaction check
---> Package vim-filesystem.x86_64 2:7.4.629-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                              Arch                        Version                                         Repository                  Size
===================================================================================================================================================
Installing:
 bash-completion                      noarch                      1:2.1-8.el7                                     local                       87 k
 net-tools                            x86_64                      2.0-0.25.20131004git.el7                        local                      306 k
 vim-enhanced                         x86_64                      2:7.4.629-7.el7                                 local                      1.1 M
Installing for dependencies:
 gpm-libs                             x86_64                      1.20.7-6.el7                                    local                       32 k
 vim-common                           x86_64                      2:7.4.629-7.el7                                 local                      5.9 M
 vim-filesystem                       x86_64                      2:7.4.629-7.el7                                 local                       11 k

Transaction Summary
===================================================================================================================================================
Install  3 Packages (+3 Dependent packages)

Total download size: 7.4 M
Installed size: 25 M
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              5.3 MB/s | 7.4 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gpm-libs-1.20.7-6.el7.x86_64                                                                                                    1/6
  Installing : 2:vim-filesystem-7.4.629-7.el7.x86_64                                                                                           2/6
  Installing : 2:vim-common-7.4.629-7.el7.x86_64                                                                                               3/6
  Installing : 2:vim-enhanced-7.4.629-7.el7.x86_64                                                                                             4/6
  Installing : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       5/6
  Installing : 1:bash-completion-2.1-8.el7.noarch                                                                                              6/6
  Verifying  : 2:vim-common-7.4.629-7.el7.x86_64                                                                                               1/6
  Verifying  : 2:vim-filesystem-7.4.629-7.el7.x86_64                                                                                           2/6
  Verifying  : 1:bash-completion-2.1-8.el7.noarch                                                                                              3/6
  Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       4/6
  Verifying  : gpm-libs-1.20.7-6.el7.x86_64                                                                                                    5/6
  Verifying  : 2:vim-enhanced-7.4.629-7.el7.x86_64                                                                                             6/6

Installed:
  bash-completion.noarch 1:2.1-8.el7           net-tools.x86_64 0:2.0-0.25.20131004git.el7           vim-enhanced.x86_64 2:7.4.629-7.el7

Dependency Installed:
  gpm-libs.x86_64 0:1.20.7-6.el7               vim-common.x86_64 2:7.4.629-7.el7               vim-filesystem.x86_64 2:7.4.629-7.el7

Complete!
[root@centos7 yum.repos.d]# ntpdate 120.25.108.11
-bash: ntpdate: command not found
[root@centos7 yum.repos.d]# yum install ntpdate -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                        Arch                          Version                                           Repository                    Size
===================================================================================================================================================
Installing:
 ntpdate                        x86_64                        4.2.6p5-29.el7.centos.2                           local                         87 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 87 k
Installed size: 121 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                                                                                          1/1
  Verifying  : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                                                                                          1/1

Installed:
  ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2

Complete!
[root@centos7 yum.repos.d]# ntpdate 120.25.108.11
 9 Jul 00:35:35 ntpdate[17012]: no server suitable for synchronization found
[root@centos7 yum.repos.d]# ntpdate
 9 Jul 00:35:46 ntpdate[17125]: no servers can be used, exiting
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm local.repo
rm: remove regular file ‘local.repo’?
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2025-07-09 00:46:06--  https://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 36.249.88.86, 36.250.15.228, 36.250.15.232, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|36.249.88.86|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 2,523       --.-K/s   in 0s

2025-07-09 00:46:06 (145 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
Other repos take up 51 M of disk space (use --verbose for details)
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                      | 2.9 kB  00:00:00
updates                                                                                                                     | 2.9 kB  00:00:00
(1/10): extras/7/x86_64/filelists_db                                                                                        | 305 kB  00:00:00
(2/10): extras/7/x86_64/primary_db                                                                                          | 253 kB  00:00:00
(3/10): extras/7/x86_64/other_db                                                                                            | 154 kB  00:00:00
(4/10): base/7/x86_64/group_gz                                                                                              | 153 kB  00:00:00
(5/10): base/7/x86_64/other_db                                                                                              | 2.6 MB  00:00:00
(6/10): updates/7/x86_64/other_db                                                                                           | 1.6 MB  00:00:00
(7/10): updates/7/x86_64/filelists_db                                                                                       |  15 MB  00:00:01
base/7/x86_64/primary_db       FAILED
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.cloud.aliyuncs.com:80; Connection refused"
Trying other mirror.
base/7/x86_64/filelists_db     FAILED                                          =====                             ] 267 kB/s |  25 MB  00:02:16 ETA
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/d6d94c7d406fe7ad4902a97104b39a0d8299451832a97f31d71653ba982c955b-filelists.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(8/10): base/7/x86_64/primary_db                                                                                            | 6.1 MB  00:00:00
(9/10): base/7/x86_64/filelists_db                                                                                          | 7.2 MB  00:00:00
updates/7/x86_64/primary_db    FAILED
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/f19044932626155f0cd849e88972b84875fc85e3308b4d622844a911c4ef54d0-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(10/10): updates/7/x86_64/primary_db                                                                                        |  27 MB  00:00:01
Metadata Cache Created
[root@centos7 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id                                                    repo name                                                                         status
!base/7/x86_64                                             CentOS-7 - Base - mirrors.aliyun.com                                              10,072
!extras/7/x86_64                                           CentOS-7 - Extras - mirrors.aliyun.com                                               526
!updates/7/x86_64                                          CentOS-7 - Updates - mirrors.aliyun.com                                            6,173
repolist: 16,771
[root@centos7 yum.repos.d]# ping 120.25.108.11
PING 120.25.108.11 (120.25.108.11) 56(84) bytes of data.
^C
--- 120.25.108.11 ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13003ms

[root@centos7 yum.repos.d]# ping www.baidu.com
PING www.wshifen.com (103.235.46.115) 56(84) bytes of data.
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=1 ttl=128 time=113 ms
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=2 ttl=128 time=116 ms
^C
--- www.wshifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 113.805/114.918/116.032/1.163 ms
[root@centos7 yum.repos.d]# ping 120.25.108.11
PING 120.25.108.11 (120.25.108.11) 56(84) bytes of data.
^C
--- 120.25.108.11 ping statistics ---
17 packets transmitted, 0 received, 100% packet loss, time 16008ms

[root@centos7 yum.repos.d]# ntpdate ntp.aliyun.com
 9 Jul 20:58:52 ntpdate[27920]: adjust time server 203.107.6.88 offset -0.317821 sec
[root@centos7 yum.repos.d]#

[root@centos7 yum.repos.d]# shutdown
Shutdown scheduled for Wed 2025-07-09 21:01:45 CST, use 'shutdown -c' to cancel.
[root@centos7 yum.repos.d]#
Broadcast message from root@centos7.cn (Wed 2025-07-09 21:00:45 CST):

The system is going down for power-off at Wed 2025-07-09 21:01:45 CST!


在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
[root@centos7 mysql_3306]# yum install devtoolset-9 -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - “Could not resolve host: mirrorlist.centos.org; Unknown error”

One of the configured repositories failed (Unknown),
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: centos-sclo-rh/x86_64

root@192.168.235.130's password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to root@192.168.235.130                              │
     │   • SSH compression : ✘                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✘  (disabled or not supported by server)     │
     │   • DISPLAY         : 192.168.1.171:0.0                            │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Tue Jul  8 22:59:51 2025
[root@centos7 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                                                                                                                   repo name
local                                                                                                                                     local nam
repolist: 4,070
[root@centos7 ~]# yum install wget -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                                           Arch                                                                Version
===================================================================================================================================================
Installing:
 wget                                                              x86_64                                                              1.14-18.el7_

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 547 k
Installed size: 2.0 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wget-1.14-18.el7_6.1.x86_64
  Verifying  : wget-1.14-18.el7_6.1.x86_64

Installed:
  wget.x86_64 0:1.14-18.el7_6.1

Complete!
[root@centos7 ~]# cd /etc/yum.repos.d
[root@centos7 yum.repos.d]# ls
local.repo  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/centos7_base                                .repo
--2025-07-08 23:37:21--  http://mirrors.cloud.tencent.com/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-07-08 23:37:22 ERROR 404: Not Found.

[root@centos7 yum.repos.d]# ping www.baidu.com
PING www.wshifen.com (103.235.46.115) 56(84) bytes of data.
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=1 ttl=128 time=121 ms
^C
--- www.wshifen.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 121.546/121.546/121.546/0.000 ms
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base,repo
--2025-07-08 23:44:49--  http://mirrors.cloud.tencent.com/repo/centos7_base,repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-07-08 23:44:50 ERROR 404: Not Found.

[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
--2025-07-08 23:45:03--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 122.225.32.220, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|122.225.32.220|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================>] 1,694       --.-K/s   in 0s

2025-07-08 23:45:03 (47.9 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1694/1694]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras local os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors


^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.c                om/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 186158 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Da                maged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com                /centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 186158 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Dama                ged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.repo  repo.tar.gz
[root@centos7 yum.repos.d]# tar -zcf local.tar.gz local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
extras                                                                                                      | 2.9 kB  00:00:00
os                                                                                                          | 3.6 kB  00:00:00
updates                                                                                                     | 2.9 kB  00:00:00
(1/10): extras/7/x86_64/filelists_db                                                                        | 305 kB  00:00:00
(2/10): extras/7/x86_64/other_db                                                                            | 154 kB  00:00:00
(3/10): os/7/x86_64/filelists_db                                                                            | 7.2 MB  00:00:01
(4/10): os/7/x86_64/primary_db                                                                              | 6.1 MB  00:00:01
(5/10): os/7/x86_64/other_db                                                                                | 2.6 MB  00:00:00
(6/10): updates/7/x86_64/primary_db                                                                         |  27 MB  00:00:05
(7/10): updates/7/x86_64/other_db                                                                           | 1.6 MB  00:00:00
ss
^C

Exiting on user cancel
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.c                om/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 49611 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Da                maged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com                /centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 49611 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Dama                ged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[os]
name=Qcloud centos os - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=Qcloud centos updates - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[centosplus]
name=Qcloud centosplus - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[cr]
name=Qcloud centos cr - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/cr/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[extras]
name=Qcloud centos extras - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[fasttrack]
name=Qcloud centos fasttrack - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# yum cleanall
Loaded plugins: fastestmirror
No such command: cleanall. Please use /usr/bin/yum --help
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 103913 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 103913 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@centos7 yum.repos.d]# wget -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror


File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'--2025-07-09 00:03:30--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo\n'
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror


File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'--2025-07-09 00:03:30--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo\n'
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv: overwrite ‘/etc/yum.repos.d/CentOS-Base.repo.backup’?
[root@centos7 yum.repos.d]# ls
centos7_base.repo  CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# cat  centos7_base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[os]
name=Qcloud centos os - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=Qcloud centos updates - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[centosplus]
name=Qcloud centosplus - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[cr]
name=Qcloud centos cr - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/cr/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[extras]
name=Qcloud centos extras - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7

[fasttrack]
name=Qcloud centos fasttrack - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# ld
ld: no input files
[root@centos7 yum.repos.d]# ls
centos7_base.repo  CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f centos7_base.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv: overwrite ‘/etc/yum.repos.d/CentOS-Base.repo.backup’? yes
[root@centos7 yum.repos.d]# ls -l
total 12
-rw-r--r--. 1 root root  568 Jul  9 00:03 CentOS-Base.repo.backup
-rw-r--r--. 1 root root  176 Jul  8 23:50 local.tar.gz
-rw-r--r--. 1 root root 2705 Jul  8 23:16 repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
--2025-07-09 00:10:17--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 42.7.49.72, 240e:f7:4f00:2502:2c::7
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|42.7.49.72|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694 (1.7K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 1,694       --.-K/s   in 0s

2025-07-09 00:10:18 (74.8 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1694/1694]

[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: extras os updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95598 milliseconds')
Trying other mirror.
^Chttp://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (Qcloud centos extras - x86_64),
 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=extras ...

     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 extras
        or
            subscription-manager repos --disable=extras

     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=extras.skip_if_unavailable=true

failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95598 milliseconds')
http://mirrors.cloud.tencent.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for extras: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -rf CentOS-Base.repo
[root@centos7 yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tencent.com/repo/centos7_base.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
^C
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2025-07-09 00:24:33--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 36.249.88.92, 36.250.15.232, 36.250.15.227, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|36.249.88.92|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 2,523       --.-K/s   in 0s

2025-07-09 00:24:33 (127 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
^Chttp://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95270 milliseconds')
Trying other mirror.
^Chttp://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttp://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttp://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base - mirrors.aliyun.com),
 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=base ...

     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 base
        or
            subscription-manager repos --disable=base

     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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 95270 milliseconds')
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# vim CentOS-Base.repo
-bash: vim: command not found
[root@centos7 yum.repos.d]# vi CentOS-Base.repo
[root@centos7 yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
        https://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
        https://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
^Chttps://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 48354 milliseconds')
Trying other mirror.
^Chttps://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttps://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
^Chttps://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base - mirrors.aliyun.com),
 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=base ...

     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 base
        or
            subscription-manager repos --disable=base

     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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Resolving timed out after 48354 milliseconds')
https://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
https://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f CentOS-Base.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# tar xf local.tar.gz
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: local
Cleaning up list of fastest mirrors
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
local                                                                                                                       | 3.6 kB  00:00:00
(1/4): local/group_gz                                                                                                       | 153 kB  00:00:00
(2/4): local/primary_db                                                                                                     | 3.3 MB  00:00:00
(3/4): local/filelists_db                                                                                                   | 3.3 MB  00:00:00
(4/4): local/other_db                                                                                                       | 1.3 MB  00:00:00
Metadata Cache Created
[root@centos7 yum.repos.d]# yum install bash-completion vim net-tools nepdate -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package nepdate available.
Resolving Dependencies
--> Running transaction check
---> Package bash-completion.noarch 1:2.1-8.el7 will be installed
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
---> Package vim-enhanced.x86_64 2:7.4.629-7.el7 will be installed
--> Processing Dependency: vim-common = 2:7.4.629-7.el7 for package: 2:vim-enhanced-7.4.629-7.el7.x86_64
--> Processing Dependency: libgpm.so.2()(64bit) for package: 2:vim-enhanced-7.4.629-7.el7.x86_64
--> Running transaction check
---> Package gpm-libs.x86_64 0:1.20.7-6.el7 will be installed
---> Package vim-common.x86_64 2:7.4.629-7.el7 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.4.629-7.el7.x86_64
--> Running transaction check
---> Package vim-filesystem.x86_64 2:7.4.629-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                              Arch                        Version                                         Repository                  Size
===================================================================================================================================================
Installing:
 bash-completion                      noarch                      1:2.1-8.el7                                     local                       87 k
 net-tools                            x86_64                      2.0-0.25.20131004git.el7                        local                      306 k
 vim-enhanced                         x86_64                      2:7.4.629-7.el7                                 local                      1.1 M
Installing for dependencies:
 gpm-libs                             x86_64                      1.20.7-6.el7                                    local                       32 k
 vim-common                           x86_64                      2:7.4.629-7.el7                                 local                      5.9 M
 vim-filesystem                       x86_64                      2:7.4.629-7.el7                                 local                       11 k

Transaction Summary
===================================================================================================================================================
Install  3 Packages (+3 Dependent packages)

Total download size: 7.4 M
Installed size: 25 M
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              5.3 MB/s | 7.4 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gpm-libs-1.20.7-6.el7.x86_64                                                                                                    1/6
  Installing : 2:vim-filesystem-7.4.629-7.el7.x86_64                                                                                           2/6
  Installing : 2:vim-common-7.4.629-7.el7.x86_64                                                                                               3/6
  Installing : 2:vim-enhanced-7.4.629-7.el7.x86_64                                                                                             4/6
  Installing : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       5/6
  Installing : 1:bash-completion-2.1-8.el7.noarch                                                                                              6/6
  Verifying  : 2:vim-common-7.4.629-7.el7.x86_64                                                                                               1/6
  Verifying  : 2:vim-filesystem-7.4.629-7.el7.x86_64                                                                                           2/6
  Verifying  : 1:bash-completion-2.1-8.el7.noarch                                                                                              3/6
  Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       4/6
  Verifying  : gpm-libs-1.20.7-6.el7.x86_64                                                                                                    5/6
  Verifying  : 2:vim-enhanced-7.4.629-7.el7.x86_64                                                                                             6/6

Installed:
  bash-completion.noarch 1:2.1-8.el7           net-tools.x86_64 0:2.0-0.25.20131004git.el7           vim-enhanced.x86_64 2:7.4.629-7.el7

Dependency Installed:
  gpm-libs.x86_64 0:1.20.7-6.el7               vim-common.x86_64 2:7.4.629-7.el7               vim-filesystem.x86_64 2:7.4.629-7.el7

Complete!
[root@centos7 yum.repos.d]# ntpdate 120.25.108.11
-bash: ntpdate: command not found
[root@centos7 yum.repos.d]# yum install ntpdate -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                        Arch                          Version                                           Repository                    Size
===================================================================================================================================================
Installing:
 ntpdate                        x86_64                        4.2.6p5-29.el7.centos.2                           local                         87 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 87 k
Installed size: 121 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                                                                                          1/1
  Verifying  : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                                                                                          1/1

Installed:
  ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2

Complete!
[root@centos7 yum.repos.d]# ntpdate 120.25.108.11
 9 Jul 00:35:35 ntpdate[17012]: no server suitable for synchronization found
[root@centos7 yum.repos.d]# ntpdate
 9 Jul 00:35:46 ntpdate[17125]: no servers can be used, exiting
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm local.repo
rm: remove regular file ‘local.repo’?
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.repo  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# rm -f local.repo
[root@centos7 yum.repos.d]# ls
CentOS-Base.repo.backup  local.tar.gz  repo.tar.gz
[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2025-07-09 00:46:06--  https://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 36.249.88.86, 36.250.15.228, 36.250.15.232, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|36.249.88.86|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 2,523       --.-K/s   in 0s

2025-07-09 00:46:06 (145 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
Other repos take up 51 M of disk space (use --verbose for details)
[root@centos7 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                      | 2.9 kB  00:00:00
updates                                                                                                                     | 2.9 kB  00:00:00
(1/10): extras/7/x86_64/filelists_db                                                                                        | 305 kB  00:00:00
(2/10): extras/7/x86_64/primary_db                                                                                          | 253 kB  00:00:00
(3/10): extras/7/x86_64/other_db                                                                                            | 154 kB  00:00:00
(4/10): base/7/x86_64/group_gz                                                                                              | 153 kB  00:00:00
(5/10): base/7/x86_64/other_db                                                                                              | 2.6 MB  00:00:00
(6/10): updates/7/x86_64/other_db                                                                                           | 1.6 MB  00:00:00
(7/10): updates/7/x86_64/filelists_db                                                                                       |  15 MB  00:00:01
base/7/x86_64/primary_db       FAILED
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.cloud.aliyuncs.com:80; Connection refused"
Trying other mirror.
base/7/x86_64/filelists_db     FAILED                                          =====                             ] 267 kB/s |  25 MB  00:02:16 ETA
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/d6d94c7d406fe7ad4902a97104b39a0d8299451832a97f31d71653ba982c955b-filelists.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(8/10): base/7/x86_64/primary_db                                                                                            | 6.1 MB  00:00:00
(9/10): base/7/x86_64/filelists_db                                                                                          | 7.2 MB  00:00:00
updates/7/x86_64/primary_db    FAILED
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/f19044932626155f0cd849e88972b84875fc85e3308b4d622844a911c4ef54d0-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(10/10): updates/7/x86_64/primary_db                                                                                        |  27 MB  00:00:01
Metadata Cache Created
[root@centos7 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id                                                    repo name                                                                         status
!base/7/x86_64                                             CentOS-7 - Base - mirrors.aliyun.com                                              10,072
!extras/7/x86_64                                           CentOS-7 - Extras - mirrors.aliyun.com                                               526
!updates/7/x86_64                                          CentOS-7 - Updates - mirrors.aliyun.com                                            6,173
repolist: 16,771
[root@centos7 yum.repos.d]# ping 120.25.108.11
PING 120.25.108.11 (120.25.108.11) 56(84) bytes of data.
^C
--- 120.25.108.11 ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13003ms

[root@centos7 yum.repos.d]# ping www.baidu.com
PING www.wshifen.com (103.235.46.115) 56(84) bytes of data.
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=1 ttl=128 time=113 ms
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=2 ttl=128 time=116 ms
^C
--- www.wshifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 113.805/114.918/116.032/1.163 ms
[root@centos7 yum.repos.d]# ping 120.25.108.11
PING 120.25.108.11 (120.25.108.11) 56(84) bytes of data.
^C
--- 120.25.108.11 ping statistics ---
17 packets transmitted, 0 received, 100% packet loss, time 16008ms

[root@centos7 yum.repos.d]# ntpdate ntp.aliyun.com
 9 Jul 20:58:52 ntpdate[27920]: adjust time server 203.107.6.88 offset -0.317821 sec
[root@centos7 yum.repos.d]# shutdown
Shutdown scheduled for Wed 2025-07-09 21:01:45 CST, use 'shutdown -c' to cancel.
[root@centos7 yum.repos.d]#
Broadcast message from root@centos7.cn (Wed 2025-07-09 21:00:45 CST):

The system is going down for power-off at Wed 2025-07-09 21:01:45 CST!


Remote side unexpectedly closed network connection

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Session stopped
    - Press <return> to exit tab
    - Press R to restart session
    - Press S to save terminal output to file
root@192.168.235.130's password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to root@192.168.235.130                              │
     │   • SSH compression : ✘                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  :(disabled or not supported by server)     │
     │   • DISPLAY         : 192.168.1.171:0.0                            │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Wed Jul  9 21:04:21 2025
[root@centos7 ~]# hostname
centos7.cn
[root@centos7 ~]# hostnamectl set-hostname mysql.cn
[root@centos7 ~]# hostname
mysql.cn
[root@centos7 ~]# systemctl restart network
[root@centos7 ~]# yum install libaio -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                      | 2.9 kB  00:00:00
updates                                                                                                                     | 2.9 kB  00:00:00
Package libaio-0.3.109-13.el7.x86_64 already installed and latest version
Nothing to do
[root@centos7 ~]# tar -xf mysql-8.0.42-linux-glibc2.28-x86_64.tar.xz
[root@centos7 ~]# ls mysql-8.0.42-linux-glibc2.28-x86_64
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@centos7 ~]# useradd -r -s /sbin/nologin mysql
[root@centos7 ~]# id mysql
uid=998(mysql) gid=996(mysql) groups=996(mysql)
[root@centos7 ~]# rm -rf /etc/my.cnf
[root@centos7 ~]# mv mysql-8.0.42-linux-glibc2.28-x86_64 /mysql_3306
[root@centos7 ~]# cd /mysql_3306/
[root@centos7 mysql_3306]# mkdir mysql-files
[root@centos7 mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  mysql-files  README  share  support-files
[root@centos7 mysql_3306]# ls -l
total 268
drwxr-xr-x  2 7161 31415   4096 Mar 31 18:14 bin
drwxr-xr-x  2 7161 31415     38 Mar 31 18:14 docs
drwxr-xr-x  3 7161 31415    282 Mar 31 18:14 include
drwxr-xr-x  6 7161 31415    201 Mar 31 18:14 lib
-rw-r--r--  1 7161 31415 259904 Mar 31 16:19 LICENSE
drwxr-xr-x  4 7161 31415     30 Mar 31 18:14 man
drwxr-xr-x  2 root root       6 Jul  9 21:25 mysql-files
-rw-r--r--  1 7161 31415    666 Mar 31 16:19 README
drwxr-xr-x 28 7161 31415   4096 Mar 31 18:14 share
drwxr-xr-x  2 7161 31415     77 Mar 31 18:14 support-files
[root@centos7 mysql_3306]# chown mysql:mysql mysql-files
[root@centos7 mysql_3306]# chmod 750 mysql-files/
[root@centos7 mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by bin/mysqld)
bin/mysqld: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /mysql_3306/bin/../lib/private/libcrypto.so.3)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
[root@centos7 mysql_3306]# ntpdate
 9 Jul 21:28:36 ntpdate[10071]: no servers can be used, exiting
[root@centos7 mysql_3306]# which ntpdate
/usr/sbin/ntpdate
[root@centos7 mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by bin/mysqld)
bin/mysqld: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /mysql_3306/bin/../lib/private/libcrypto.so.3)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /mysql_3306/bin/../lib/private/libprotobuf-lite.so.24.4.0)
[root@centos7 mysql_3306]# yum install centos-release-scl -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package centos-release-scl.noarch 0:2-3.el7.centos will be installed
--> Processing Dependency: centos-release-scl-rh for package: centos-release-scl-2-3.el7.centos.noarch
--> Running transaction check
---> Package centos-release-scl-rh.noarch 0:2-3.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                     Arch                         Version                               Repository                    Size
===================================================================================================================================================
Installing:
 centos-release-scl                          noarch                       2-3.el7.centos                        extras                        12 k
Installing for dependencies:
 centos-release-scl-rh                       noarch                       2-3.el7.centos                        extras                        12 k

Transaction Summary
===================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 24 k
Installed size: 39 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/centos-release-scl-2-3.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for centos-release-scl-2-3.el7.centos.noarch.rpm is not installed
(1/2): centos-release-scl-2-3.el7.centos.noarch.rpm                                                                         |  12 kB  00:00:10
(2/2): centos-release-scl-rh-2-3.el7.centos.noarch.rpm                                                                      |  12 kB  00:00:10
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              2.3 kB/s |  24 kB  00:00:10
Retrieving key from http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 From       : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : centos-release-scl-rh-2-3.el7.centos.noarch                                                                                     1/2
  Installing : centos-release-scl-2-3.el7.centos.noarch                                                                                        2/2
  Verifying  : centos-release-scl-2-3.el7.centos.noarch                                                                                        1/2
  Verifying  : centos-release-scl-rh-2-3.el7.centos.noarch                                                                                     2/2

Installed:
  centos-release-scl.noarch 0:2-3.el7.centos

Dependency Installed:
  centos-release-scl-rh.noarch 0:2-3.el7.centos

Complete!
[root@centos7 mysql_3306]# yum install devtoolset-9 -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 One of the configured repositories failed (Unknown),
 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: centos-sclo-rh/x86_64
[root@centos7 mysql_3306]# cat /etc/resolv.conf
# Generated by NetworkManager
search cn
nameserver 8.8.8.8
nameserver 119.29.29.29
[root@centos7 mysql_3306]# vim /etc/resolv.conf
[root@centos7 mysql_3306]# cat /etc/resolv.conf
# Generated by NetworkManager
search cn
nameserver 8.8.8.8
nameserver 119.29.29.29
nameserver 223.5.5.5
[root@centos7 mysql_3306]# ping mirrorlist.centos.org
ping: mirrorlist.centos.org: Name or service not known
[root@centos7 mysql_3306]# systemctl restart network
[root@centos7 mysql_3306]# ping mirrorlist.centos.org
ping: mirrorlist.centos.org: Name or service not known
[root@centos7 mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  mysql-files  README  share  support-files
[root@centos7 mysql_3306]# cd /
[root@centos7 /]# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  mysql_3306  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[root@centos7 /]# cd ~
[root@centos7 ~]# ls
anaconda-ks.cfg  mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz  mysql-8.0.42-linux-glibc2.28-x86_64.tar.xz
[root@centos7 ~]# tar xf mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz
[root@centos7 ~]# rm -f /mysql_3306/
rm: cannot remove ‘/mysql_3306/’: Is a directory
[root@centos7 ~]# rm -f /mysql_3306/
rm: cannot remove ‘/mysql_3306/’: Is a directory
[root@centos7 ~]# rm -f /m
media/      mnt/        mysql_3306/
[root@centos7 ~]# rm -f /mysql_3306
rm: cannot remove ‘/mysql_3306’: Is a directory
[root@centos7 ~]# rm -rf /mysql_3306/
[root@centos7 ~]# mv mysql-5.7.31-linux-glibc2.12-x86_64 /mysql_3306
[root@centos7 ~]# cd /mysql_3306/
[root@centos7 mysql_3306]# cd ~
[root@centos7 ~]# ls
anaconda-ks.cfg  mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz  mysql-8.0.42-linux-glibc2.28-x86_64.tar.xz
[root@centos7 ~]# cd mysql-files
-bash: cd: mysql-files: No such file or directory
[root@centos7 ~]# ls
anaconda-ks.cfg  mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz  mysql-8.0.42-linux-glibc2.28-x86_64.tar.xz
[root@centos7 ~]# cd /mysql_3306/
[root@centos7 mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@centos7 mysql_3306]# mkdir mysql-files
[root@centos7 mysql_3306]# chown mysql.mysql mysql-files
[root@centos7 mysql_3306]# ls -l mysql-files/
total 0
[root@centos7 mysql_3306]# ls -l
total 288
drwxr-xr-x  2  7161 31415   4096 Jun  2  2020 bin
drwxr-xr-x  2  7161 31415     55 Jun  2  2020 docs
drwxr-xr-x  3  7161 31415   4096 Jun  2  2020 include
drwxr-xr-x  5  7161 31415    205 Jun  2  2020 lib
-rw-r--r--  1  7161 31415 275393 Jun  2  2020 LICENSE
drwxr-xr-x  4  7161 31415     30 Jun  2  2020 man
drwxr-xr-x  2 mysql mysql      6 Jul  9 22:06 mysql-files
-rw-r--r--  1  7161 31415    587 Jun  2  2020 README
drwxr-xr-x 28  7161 31415   4096 Jun  2  2020 share
drwxr-xr-x  2  7161 31415     90 Jun  2  2020 support-files
[root@centos7 mysql_3306]# chmod 750 mysql-files
[root@centos7 mysql_3306]# ll -d mysql-files/
drwxr-x--- 2 mysql mysql 6 Jul  9 22:06 mysql-files/
[root@centos7 mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  mysql-files  README  share  support-files
[root@centos7 mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-07-09T14:09:48.646845Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-07-09T14:09:48.822750Z 0 [Warning] InnoDB: New log files created, LSN=45790
2025-07-09T14:09:48.847729Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2025-07-09T14:09:48.901190Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5fd0a076-5cce-11f0-8e1c-000c29815f4b.
2025-07-09T14:09:48.901822Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2025-07-09T14:09:49.276289Z 0 [Warning] CA certificate ca.pem is self signed.
2025-07-09T14:09:49.305643Z 1 [Note] A temporary password is generated for root@localhost: 0u#c+s4iWi7u
[root@centos7 mysql_3306]# ls
bin  data  docs  include  lib  LICENSE  man  mysql-files  README  share  support-files
[root@centos7 mysql_3306]# ls data
auto.cnf    ca.pem           client-key.pem  ibdata1      ib_logfile1  performance_schema  public_key.pem   server-key.pem
ca-key.pem  client-cert.pem  ib_buffer_pool  ib_logfile0  mysql        private_key.pem     server-cert.pem  sys
[root@centos7 mysql_3306]# bin/mysql_ssl_rsa_setup --datadir=/mysql_3306/data
[root@centos7 mysql_3306]# cp support-files/mysql.server /etc/init.d/mysql_3306
[root@centos7 mysql_3306]# vim /etc/init.d/mysql_3306
[root@centos7 mysql_3306]# cat /etc/init.d/mysql_3306
#!/bin/sh
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind

# MySQL daemon start/stop script.

# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.

# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 64 36
# description: A very fast and reliable SQL database engine.

# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO

# If you install MySQL on some other places than /usr/local/mysql, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
# - Create a /etc/my.cnf file with the following information:
#   [mysqld]
#   basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
#   and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
#   below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.

# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.

basedir=/mysql_3306
datadir=/mysql_3306/data

# Default value, in seconds, afterwhich the script should timeout waiting
# for server start.
# Value here is overriden by value in my.cnf.
# 0 means don't wait at all
# Negative numbers mean to wait indefinitely
service_startup_timeout=900

# Lock directory for RedHat / SuSE.
lockdir='/var/lock/subsys'
lock_file_path="$lockdir/mysql"

# The following variables are only set for letting mysql.server find things.

# Set some defaults
mysqld_pid_file_path=
if test -z "$basedir"
then
  basedir=/usr/local/mysql
  bindir=/usr/local/mysql/bin
  if test -z "$datadir"
  then
    datadir=/usr/local/mysql/data
  fi
  sbindir=/usr/local/mysql/bin
  libexecdir=/usr/local/mysql/bin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  libexecdir="$basedir/libexec"
fi

# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set=

#
# Use LSB init script functions for printing messages, if possible
#
lsb_functions="/lib/lsb/init-functions"
if test -f $lsb_functions ; then
  . $lsb_functions
else
  log_success_msg()
  {
    echo " SUCCESS! $@"
  }
  log_failure_msg()
  {
    echo " ERROR! $@"
  }
fi

PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH

mode=$1    # start or stop

[ $# -ge 1 ] && shift


other_args="$*"   # uncommon, but needed when called from an RPM upgrade action
           # Expected: "--skip-networking --skip-grant-tables"
           # They are not checked here, intentionally, as it is the resposibility
           # of the "spec" file author to give correct arguments only.

case `echo "testing\c"`,`echo -n testing` in
    *c*,-n*) echo_n=   echo_c=     ;;
    *c*,*)   echo_n=-n echo_c=     ;;
    *)       echo_n=   echo_c='\c' ;;
esac

parse_server_arguments() {
  for arg do
    case "$arg" in
      --basedir=*)  basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
                    bindir="$basedir/bin"
                    if test -z "$datadir_set"; then
                      datadir="$basedir/data"
                    fi
                    sbindir="$basedir/sbin"
                    libexecdir="$basedir/libexec"
        ;;
      --datadir=*)  datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
                    datadir_set=1
        ;;
      --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
    esac
  done
}

wait_for_pid () {
  verb="$1"           # created | removed
  pid="$2"            # process ID of the program operating on the pid-file
  pid_file_path="$3" # path to the PID file.

  i=0
  avoid_race_condition="by checking again"

  while test $i -ne $service_startup_timeout ; do

    case "$verb" in
      'created')
        # wait for a PID-file to pop into existence.
        test -s "$pid_file_path" && i='' && break
        ;;
      'removed')
        # wait for this PID-file to disappear
        test ! -s "$pid_file_path" && i='' && break
        ;;
      *)
        echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
        exit 1
        ;;
    esac

    # if server isn't running, then pid-file will never be updated
    if test -n "$pid"; then
      if kill -0 "$pid" 2>/dev/null; then
        :  # the server still runs
      else
        # The server may have exited between the last pid-file check and now.
        if test -n "$avoid_race_condition"; then
          avoid_race_condition=""
          continue  # Check again.
        fi

        # there's nothing that will affect the file.
        log_failure_msg "The server quit without updating PID file ($pid_file_path)."
        return 1  # not waiting any more.
      fi
    fi

    echo $echo_n ".$echo_c"
    i=`expr $i + 1`
    sleep 1

  done

  if test -z "$i" ; then
    log_success_msg
    return 0
  else
    log_failure_msg
    return 1
  fi
}

# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
if test -x "$bindir/my_print_defaults";  then
  print_defaults="$bindir/my_print_defaults"
else
  # Try to find basedir in /etc/my.cnf
  conf=/etc/my.cnf
  print_defaults=
  if test -r $conf
  then
    subpat='^[^=]*basedir[^=]*=\(.*\)$'
    dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
    for d in $dirs
    do
      d=`echo $d | sed -e 's/[  ]//g'`
      if test -x "$d/bin/my_print_defaults"
      then
        print_defaults="$d/bin/my_print_defaults"
        break
      fi
    done
  fi

  # Hope it's in the PATH ... but I doubt it
  test -z "$print_defaults" && print_defaults="my_print_defaults"
fi

#
# Read defaults file from 'basedir'.   If there is no defaults file there
# check if it's in the old (depricated) place (datadir) and read it from there
#

extra_args=""
if test -r "$basedir/my.cnf"
then
  extra_args="-e $basedir/my.cnf"
fi

parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`

#
# Set pid file if not given
#
if test -z "$mysqld_pid_file_path"
then
  mysqld_pid_file_path=$datadir/`hostname`.pid
else
  case "$mysqld_pid_file_path" in
    /* ) ;;
    * )  mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
  esac
fi

case "$mode" in
  'start')
    # Start daemon

    # Safeguard (relative paths, core dumps..)
    cd $basedir

    echo $echo_n "Starting MySQL"
    if test -x $bindir/mysqld_safe
    then
      # Give extra arguments to mysqld with the my.cnf file. This script
      # may be overwritten at next upgrade.
      $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
      wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?

      # Make lock for RedHat / SuSE
      if test -w "$lockdir"
      then
        touch "$lock_file_path"
      fi

      exit $return_value
    else
      log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
    fi
    ;;

  'stop')
    # Stop daemon. We use a signal here to avoid having to know the
    # root password.

    if test -s "$mysqld_pid_file_path"
    then
      # signal mysqld_safe that it needs to stop
      touch "$mysqld_pid_file_path.shutdown"

      mysqld_pid=`cat "$mysqld_pid_file_path"`

      if (kill -0 $mysqld_pid 2>/dev/null)
      then
        echo $echo_n "Shutting down MySQL"
        kill $mysqld_pid
        # mysqld should remove the pid file when it exits, so wait for it.
        wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
      else
        log_failure_msg "MySQL server process #$mysqld_pid is not running!"
        rm "$mysqld_pid_file_path"
      fi

      # Delete lock for RedHat / SuSE
      if test -f "$lock_file_path"
      then
        rm -f "$lock_file_path"
      fi
      exit $return_value
    else
      log_failure_msg "MySQL server PID file could not be found!"
    fi
    ;;

  'restart')
    # Stop the service and regardless of whether it was
    # running or not, start it again.
    if $0 stop  $other_args; then
      $0 start $other_args
    else
      log_failure_msg "Failed to stop running server, so refusing to try to start."
      exit 1
    fi
    ;;

  'reload'|'force-reload')
    if test -s "$mysqld_pid_file_path" ; then
      read mysqld_pid <  "$mysqld_pid_file_path"
      kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
      touch "$mysqld_pid_file_path"
    else
      log_failure_msg "MySQL PID file could not be found!"
      exit 1
    fi
    ;;
  'status')
    # First, check to see if pid file exists
    if test -s "$mysqld_pid_file_path" ; then
      read mysqld_pid < "$mysqld_pid_file_path"
      if kill -0 $mysqld_pid 2>/dev/null ; then
        log_success_msg "MySQL running ($mysqld_pid)"
        exit 0
      else
        log_failure_msg "MySQL is not running, but PID file exists"
        exit 1
      fi
    else
      # Try to find appropriate mysqld process
      mysqld_pid=`pidof $libexecdir/mysqld`

      # test if multiple pids exist
      pid_count=`echo $mysqld_pid | wc -w`
      if test $pid_count -gt 1 ; then
        log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
        exit 5
      elif test -z $mysqld_pid ; then
        if test -f "$lock_file_path" ; then
          log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
          exit 2
        fi
        log_failure_msg "MySQL is not running"
        exit 3
      else
        log_failure_msg "MySQL is running but PID file could not be found"
        exit 4
      fi
    fi
    ;;
    *)
      # usage
      basename=`basename "$0"`
      echo "Usage: $basename  {start|stop|restart|reload|force-reload|status}  [ MySQL server options ]"
      exit 1
    ;;
esac

exit 0
[root@centos7 mysql_3306]# service mysql_3306 start
Starting MySQL.Logging to '/mysql_3306/data/mysql.cn.err'.
 SUCCESS!
[root@centos7 mysql_3306]# bin/mysqladmin -uroot password '123' -p
Enter password:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
[root@centos7 mysql_3306]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@centos7 mysql_3306]# chkconfig --add mysql_3306
[root@centos7 mysql_3306]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysql_3306      0:off   1:off   2:on    3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@centos7 mysql_3306]# chkconfig mysql_3306 on
[root@centos7 mysql_3306]# ls
bin  data  docs  include  lib  LICENSE  man  mysql-files  README  share  support-files
[root@centos7 mysql_3306]# chkconfig -list
-list: unknown option
[root@centos7 mysql_3306]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysql_3306      0:off   1:off   2:on    3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@centos7 mysql_3306]# echo 'export PATH=$PATH:/mysql_3306/bin'>>/etc/profile
[root@centos7 mysql_3306]# source /etc/profile
[root@centos7 mysql_3306]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye
[root@centos7 mysql_3306]# vim /mysql_3306/my.cnf
[root@centos7 mysql_3306]# cat /mysql_3306/my.cnf
[mysqld]
basedir=/mysql_3306
datadir=/mysql_3306/data
socket=/tmp/mysql.sock

[root@centos7 mysql_3306]# service mysql_3306 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!
[root@centos7 mysql_3306]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
Error: Access denied for user 'root'@'localhost' (using password: NO)
[root@centos7 mysql_3306]#
[root@centos7 mysql_3306]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No:
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) :

 ... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) :

 ... skipping.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) :

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) :

 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) :

 ... skipping.
All done!
[root@centos7 mysql_3306]# vim /mysql_3306/my.cnf
[root@centos7 mysql_3306]# vim /mysql_3306/my.cnf
[root@centos7 mysql_3306]# cat /mysql_3306/my.cnf
[mysqld]
basedir=/mysql_3306
datadir=/mysql_3306/data
socket=/tmp/mysql.sock
validate_password=OFF
[root@centos7 mysql_3306]# service mysql_3306 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL... ERROR! The server quit without updating PID file (/mysql_3306/data/mysql.cn.pid).
[root@centos7 mysql_3306]#


网站公告

今日签到

点亮在社区的每一天
去签到