Verify your system configuration to select the right package and method for installation
uname -r
> 2.6.32-696.3.2.el6.x86_64 ==> 64bit
uname -r
> Description: CentOS release 6.9 (Final) => CentOS 6.9
Upgrade to the latest 5.6
Look for the latest MySQL 5.6 minor version and get the package:
wget https://downloads.mysql.com/archives/get/p/23/file/MySQL-5.6.51-1.el6.x86_64.rpm-bundle.tar
Remove current package
sudo service mysqld stop
sudo yum -y remove mysql-community-common-5.6.36-2.el6.x86_64
tar -xvf MySQL-5.6.51-1.el6.x86_64.rpm-bundle.tar
sudo rpm -i MySQL-client-5.6.51-1.el6.x86_64.rpm
sudo rpm -i MySQL-server-5.6.51-1.el6.x86_64.rpm
sudo service mysql start
sudo mysql_upgrade
Upgrade to the latest 5.7
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.35-1.el6.x86_64.rpm-bundle.tar
sudo service mysql stop
sudo yum -y remove MySQL-server-5.6.51-1.el6.x86_64 MySQL-client-5.6.51-1.el6.x86_64
tar -xvf mysql-5.7.35-1.el6.x86_64.rpm-bundle.tar
sudo rpm -i mysql-community-libs-5.7.35-1.el6.x86_64.rpm mysql-community-common-5.7.35-1.el6.x86_64.rpm mysql-community-client-5.7.35-1.el6.x86_64.rpm mysql-community-server-5.7.35-1.el6.x86_64.rpm
sudo service mysqld start
sudo mysql_upgrade
Upgrade to the latest 8.0
Look for latest MySQL 8.0 minor version
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.26-1.el6.x86_64.rpm-bundle.tar
sudo service mysqld stop
sudo yum -y remove mysql-community-libs-5.7.35-1.el6.x86_64 mysql-community-common-5.7.35-1.el6.x86_64 mysql-community-client-5.7.35-1.el6.x86_64 mysql-community-server-5.7.35-1.el6.x86_64
tar -xvf mysql-8.0.26-1.el6.x86_64.rpm-bundle.tar
sudo rpm -i mysql-community-client-plugins-8.0.26-1.el6.x86_64.rpm mysql-community-common-8.0.26-1.el6.x86_64.rpm mysql-community-libs-8.0.26-1.el6.x86_64.rpm mysql-community-client-8.0.26-1.el6.x86_64.rpm mysql-community-server-8.0.26-1.el6.x86_64.rpm
sudo service mysqld start