Mysql Failed during Upgrade

Operating System & Version
7.9
cPanel & WHM Version
98.0.9

Sarfraz ahmad

Member
Jun 10, 2015
8
0
51
Pakistan
cPanel Access Level
Root Administrator
Hi,

I was trying to upgrade MySQL of my server. When i started upgradation it fails and disabled the MySQL and now showing following errors when i again try to upgrade it.


Starting process with log file at /var/cpanel/logs/mysql_upgrade.20211005-174828/unattended_upgrade.log
Beginning “MySQL 5.7” upgrade...
Obtained version information from system.
(XID 4z8f6h) The system failed to connect to the “MySQL” database “mysql” because of an error: CR_CONNECTION_ERROR (Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2))
Ensuring the “Mysql57” repository is available and working.
distro does not use package modules; ignoring request to disable mysql
distro does not use package modules; ignoring request to disable mariadb
checkyum version 22.3
Ensuring that the package “coreutils” is available.
The package “coreutils” with version matching “” is already installed.
Ensuring that the package “grep” is available.
The package “grep” with version matching “” is already installed.
Ensuring that the package “mysql-community-devel” with version matching “5.7” is available.
Restarting mysql service.
(XID y7frkz) The “mysql” service is disabled.
The system was not able to ensure the availability of the “mysql-community-devel” package: (XID xcs697) “/usr/bin/yum” reported error code “1” when it ended: http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.


One of the configured repositories failed (MySQL Connectors Community),
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=Mysql-connectors-community ...

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 Mysql-connectors-community
or
subscription-manager repos --disable=Mysql-connectors-community

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=Mysql-connectors-community.skip_if_unavailable=true

failure: repodata/repomd.xml from Mysql-connectors-community: [Errno 256] No more mirrors to try.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Obtained version information from system.
Proceeding with MySQL/MariaDB upgrade despite the following:
Critical: MySQL enables "strict mode" by default as of version 5.7. Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. Applications not built with strict mode enabled may cause undesired behavior; please verify applications using MySQL are compatible before upgrading. More information about strict mode is available here. Normal: The selected MySQL version (5.7) is the same as the currently installed MySQL version (5.7). No upgrade will be performed at this time, though the normal upgrade steps will still be executed. This is only useful if a previous upgrade failed while partially completed.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Hey there! I would start by checking your server's repositories in /etc/resolv.conf. You can comment out any existing nameserver entries there, and replace them with Google's public repositories to see if that allows you to connect to the repos properly:

Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
There may be other issues as well, but that is the first thing I would check for this particular issue.
 

Sarfraz ahmad

Member
Jun 10, 2015
8
0
51
Pakistan
cPanel Access Level
Root Administrator
Hey there! I would start by checking your server's repositories in /etc/resolv.conf. You can comment out any existing nameserver entries there, and replace them with Google's public repositories to see if that allows you to connect to the repos properly:

Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
There may be other issues as well, but that is the first thing I would check for this particular issue.
nameserver 127.0.0.1
nameserver 213.51.48.74

search ovh

These are the existing entries. I have replaced them with

nameserver 8.8.8.8
nameserver 8.8.4.4

but there is same issue
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for the additional details. With everything involved with MySQL and the potential for data loss, it would be best to open a ticket with our support team so we can check the system directly and see what is happening. If you are able to do that, please post the ticket number here so I can follow along and keep this thread updated with our findings.
 

Sarfraz ahmad

Member
Jun 10, 2015
8
0
51
Pakistan
cPanel Access Level
Root Administrator
Thanks for the additional details. With everything involved with MySQL and the potential for data loss, it would be best to open a ticket with our support team so we can check the system directly and see what is happening. If you are able to do that, please post the ticket number here so I can follow along and keep this thread updated with our findings.
here is the error when i again try to upgrade it.

Starting process with log file at /var/cpanel/logs/mysql_upgrade.20211005-182915/unattended_upgrade.log
Beginning “MySQL 5.7” upgrade...
Obtained version information from system.
(XID 7akssm) The system failed to connect to the “MySQL” database “mysql” because of an error: CR_CONNECTION_ERROR (Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2))
Ensuring the “Mysql57” repository is available and working.
distro does not use package modules; ignoring request to disable mysql
distro does not use package modules; ignoring request to disable mariadb
checkyum version 22.3
Ensuring that the package “coreutils” is available.
The package “coreutils” with version matching “” is already installed.
Ensuring that the package “grep” is available.
The package “grep” with version matching “” is already installed.
Ensuring that the package “mysql-community-devel” with version matching “5.7” is available.
Restarting mysql service.
(XID 2htc34) The “mysql” service is disabled.
The system was not able to ensure the availability of the “mysql-community-devel” package: (XID 957jge) “/usr/bin/yum” reported error code “1” when it ended: http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Trying other mirror.


One of the configured repositories failed (MySQL Connectors Community),
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=Mysql-connectors-community ...

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 Mysql-connectors-community
or
subscription-manager repos --disable=Mysql-connectors-community

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=Mysql-connectors-community.skip_if_unavailable=true

failure: repodata/repomd.xml from Mysql-connectors-community: [Errno 256] No more mirrors to try.
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to repo.mysql.com:80; Connection refused"
Obtained version information from system.
Proceeding with MySQL/MariaDB upgrade despite the following:
Critical: MySQL enables "strict mode" by default as of version 5.7. Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. Applications not built with strict mode enabled may cause undesired behavior; please verify applications using MySQL are compatible before upgrading. More information about strict mode is available here. Normal: The selected MySQL version (5.7) is the same as the currently installed MySQL version (5.7). No upgrade will be performed at this time, though the normal upgrade steps will still be executed. This is only useful if a previous upgrade failed while partially completed.