Reputation: 1563
I'm on CentOS 7(CentOS Linux release 7.9.2009 (Core)) starting from scratch on a new server trying to install MySQL (7 or 8).
I have followed my steps -which I have successfully completed many times in the past, as well many other sites such as:
and many others
All the methods agree on these steps:
Download and add the following MySQL Yum repository
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
Note I tried different versions 7-5, and 8
install the downloaded package
sudo yum install mysql80-community-release-el7-3.noarch.rpm -y
install MySQL:
sudo yum install mysql-server -y
On Step #3 is where the installation fails
mysql -V
-bash: mysql: command not found
And I get all these errors
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libtirpc.so.3()(64bit)
Error: Package: mysql-community-libs-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: mysql-community-libs-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libtirpc.so.3(TIRPC_0.3.3)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.22)(64bit)
Error: Package: mysql-community-client-plugins-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
Error: Package: mysql-community-client-plugins-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
Error: Package: mysql-community-libs-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.8)(64bit)
Error: Package: mysql-community-client-plugins-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.8)(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libncurses.so.6()(64bit)
Error: Package: mysql-community-client-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libtinfo.so.6()(64bit)
Error: Package: mysql-community-libs-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.11)(64bit)
Error: Package: mysql-community-client-plugins-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libc.so.6(GLIBC_2.25)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: mysql-community-server-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libtirpc.so.3(TIRPC_0.3.0)(64bit)
Error: Package: mysql-community-client-plugins-8.0.28-1.el8.x86_64 (mysql80-community)
Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
I read this post which looks similar, but no luck either
the only version that I'm able to successfully install is a very old mysql version: 5.6
Any ideas/suggestions on what I am missing; or how to solve this?
Upvotes: 12
Views: 70663
Reputation: 832
I had the same issue recently and got stuck on this error
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
even after trying all existing answers.
The following is what worked.
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
and then:
yum --enablerepo=mysql80-community install mysql-community-server
And everything was successful without warning and errors.
Start MySQL service
sudo systemctl start mysqld
sudo systemctl enable mysqld
Show the default password for the root user
sudo grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}'
Copy the password. This would be used as the root password when you run mysql_secure_installation command.
Execute the command mysql_secure_installation to secure the MySQL server:
mysql_secure_installation
Do well to follow the interactive accordingly.
Upvotes: 4
Reputation: 1563
I think I got it. Here is what I did to solve it.
# look for the mysql installed packages
sudo yum list installed | grep mysql
sudo yum remove mysql80-community-release.noarch
sudo yum clean all --verbose
#manually remove remaining mysql cache folders
#from: https://serverfault.com/questions/1028593/mysql-packages-skipped-dependency-problems
sudo rm -R /var/cache/yum/x86_64/7/mysql*
sudo yum update
from: https://tecadmin.net/install-mysql-8-on-centos/
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
yum --enablerepo=mysql80-community install mysql-community-server
Got the following error:
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: mysql-community-client-8.0.28-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
per comments below, you might need to do '2023' instead of '2022'
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum --enablerepo=mysql80-community install mysql-community-server
Got multiple warning message related to every different language; for example the one related to 'english'
warning: file /usr/share/mysql/english/errmsg.sys: remove failed: No such file or directory
warning: file /usr/share/mysql/english: remove failed: No such file or directory
However, final messages were successful:
Installed:
mysql-community-libs.x86_64 0:8.0.28-1.el7
mysql-community-libs-compat.x86_64 0:8.0.28-1.el7
mysql-community-server.x86_64 0:8.0.28-1.el7
Dependency Installed:
mysql-community-client.x86_64 0:8.0.28-1.el7
mysql-community-client-plugins.x86_64 0:8.0.28-1.el7
mysql-community-common.x86_64 0:8.0.28-1.el7
mysql-community-icu-data-files.x86_64 0:8.0.28-1.el7
Replaced:
mariadb-libs.x86_64 1:5.5.68-1.el7
Complete!
mysql -V
# output #
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
sudo yum update
sudo systemctl start mysqld
sudo systemctl status mysqld
Upvotes: 70
Reputation: 1
rpm -qa | grep mariadb
rpm -e XXX #If there is an already installed mariadb, uninstall it
rpm -e --nodeps xxx //If the preceding delete action does not work, try force delete
It did really do the magic.
Upvotes: 0
Reputation: 165
I had a problem after step 4, had an error:
my.cnf from install of mysql-community-server-8.0.32-1.el7.x86_64 conflicts with file from package MariaDB-common...
I needed to run:
yum remove mariadb-libs
and then install MYSQL. Found that here >> MySQL won't install in CentOS due to conflict with mariadb
After that installation of mysql went smooth.
Upvotes: 0
Reputation: 31759
In my case I just imported GPG-KEY:
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
After that next command runs without errors:
sudo yum install mysql-server -y
Upvotes: 10