MySQL Installation Mysql-libs RPM Conflicts Solution

MySQL Installation Mysql-libs RPM Conflicts Solution

Install Of MySQL RPM Conflicts Mysql-libs on Red Hat.

This is applies to MySQL Server - Version 5.5 and later release.
The mysql-libs package in the default build of Red Hat Enterprise Linux (RHEL) conflicts with the official MySQL RPMs. 
How can we handle this issue?
There are some inconsistencies in Red Hat's mysql-libs package for official MySQL RPMs. 
Generally, when you have conflicts over which two packages provide the same file, it will instruct the rpm client to replace the existing files with the last RPM using below command:
rpm -Uvh --replacefiles MySQL-server-....rpm
However, all MySQL RPMs must be installed, and not only RPM * -server, also shared and shared-compat RPMs. 
So assuming you have all the RPMs in the current directory, you run this command:
rpm -Uvh --replacefiles ./MySQL-*.rpm

The shared-compat RPM will replace the actual files contained in the mysql-libs package. The shared-compat RPM contains the mysql client library for 5.6, 5.5, 5.1, 5.0, 4.1, and 4.0. The MySQL RPM's actually obsolete the mysql-libs package in the RPM spec file.

how to upgrade mysql 8.0 from mysql 5.6 ?

STEP BY STEP UPGRADE MYSQL 5.6 TO MYSQL 8.0 USING RPM.

Mysql 5.6 to 8.0
Upgrade to mysql 8.0
 Download RPM MySQL-5.6.48-1.el6.x86_64.rpm-bundle.tar for installing msyql 5.6.  click here to download
STEP-1: Extract tar file.
[root@ctpdb1 MY56]# tar -xvf MySQL-5.6.48-1.el6.x86_64.rpm-bundle.tar
MySQL-devel-5.6.48-1.el6.x86_64.rpm
MySQL-client-5.6.48-1.el6.x86_64.rpm
MySQL-embedded-5.6.48-1.el6.x86_64.rpm
MySQL-server-5.6.48-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.48-1.el6.x86_64.rpm
MySQL-shared-5.6.48-1.el6.x86_64.rpm
MySQL-test-5.6.48-1.el6.x86_64.rpm
STEP-2: Now install server,client,common,libs-compat,libs packages from above extracted files.
[root@ctpdb1 MY56]# rpm -Uvh MySQL-devel-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-embedded-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-shared-compat-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-shared-5.6.48-1.el6.x86_64.rpm
[root@ctpdb1 MY56]# rpm -Uvh MySQL-server-5.6.48-1.el6.x86_64.rpm
New default config file was created as /usr/my.cnf and will be used by default by the server when you
start it. You may edit this file to change server settings. 
STEP-3: Start Mysql Services.
[root@ctpdb1 MY56]# service mysql start
Starting MySQL.Logging to '/var/lib/mysql/ctpdb1.err'.
Check root user password.
[root@ctpdb1 MY56]# cat /root/.mysql_secret
STEP-4:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! 
            It will ask about changing root user password , Remove anonymous users?, remove test database, Disallow root login remotely?, Remove test database and access to it? Reloading the privilege tables will ensure that all changes made so far will take effect immediately, Reload privilege tables now? Answer depend on your use.
[root@ctpdb1 MY56]# /usr/bin/mysql_secure_installation
All done! If you've completed all of the above steps, your MySQL installation should now be secure. 
STEP-5:Login to mysql 5.6 database.
[root@ctpdb1 MY56]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.48 MySQL Community Server (GPL)
sql>select version
+-----------+
| version() |
+-----------+
| 5.6.48 |
+-----------+
Before upgrading to mysql 8.0 you need to upgrade existing mysql 5.6 to mysql 5.7 . Click Here to download MySql 5.7 RPM packages. 
STEP-6:Stop mysql 5.6 services and extract mysql 5.7 tar files.
[root@ctpdb1 ~]# service mysql stop
Shutting down MySQL.. [ OK ]
[root@ctpdb1 ~]# cd /CTPPROD/SOFTWARE/MY57/
[root@ctpdb1 MY57]# tar -xvf mysql-5.7.31-1.el6.x86_64.rpm-bundle.tar
mysql-community-test-5.7.31-1.el6.x86_64.rpm
mysql-community-devel-5.7.31-1.el6.x86_64.rpm
mysql-community-libs-compat-5.7.31-1.el6.x86_64.rpm
mysql-community-embedded-5.7.31-1.el6.x86_64.rpm
mysql-community-common-5.7.31-1.el6.x86_64.rpm
mysql-community-server-5.7.31-1.el6.x86_64.rpm
mysql-community-embedded-devel-5.7.31-1.el6.x86_64.rpm
mysql-community-libs-5.7.31-1.el6.x86_64.rpm
mysql-community-client-5.7.31-1.el6.x86_64.rpm
Now upgrade the Mysql 5.6 to 5.7 using below command, also you can use rpm -ivh command to upgrade mysql database.  ex. rpm -ivh mysql-community-{server,client,common,libs-compat,libs}-* mysql-5.*. 
[root@ctpdb1 MY57]# yum install mysql-community-{server,client,common,libs-compat,libs}-* mysql-5.*.
Now start service of mysql 5.7 database.
[root@ctpdb1 MY57]# service mysqld start
Starting mysqld: [ OK ]
STEP-8: Upgrading to Mysql 8.0 from Mysql 5.7 using RPM
Now same as upgrade above mysql 5.6 to 5.7 we can upgrade existing mysql 5.7 to mysql 8.0 using rpm.
[root@ctpdb1 MY8.0]# service mysqld stop
[root@ctpdb1 MY8.0]# tar -xvf mysql-8.0.21-1.el6.x86_64.rpm-bundle.tar
[root@ctpdb1 MY8.0]# yum install mysql-community-{server,client,common,libs-compat,libs}-* mysql-8.*.
[root@ctpdb1 MY8.0]# service mysqld start

Please do not forget to share your comment on below comment box.

How to Upgrade MySql 5.7 to MySql 8 Using RPM?

STEP BY STEP UPGRADE MYSQL 5.7 TO MYSQL 8.0 USING RPM PACKAGE 


Download RPM package for Mysql 8.0 for os specific from mysql official website. Click Here to download 8.0 RPM 
STEP-1: Extract the rpm tar file using tar -xvf
[root@ctpdb1 MY8.0]# tar -xvf mysql-8.0.21-1.el6.x86_64.rpm-bundle.tar
mysql-community-libs-compat-8.0.21-1.el6.x86_64.rpm
mysql-community-test-8.0.21-1.el6.x86_64.rpm
mysql-community-client-8.0.21-1.el6.x86_64.rpm
mysql-community-server-8.0.21-1.el6.x86_64.rpm
mysql-community-devel-8.0.21-1.el6.x86_64.rpm
mysql-community-libs-8.0.21-1.el6.x86_64.rpm
mysql-community-common-8.0.21-1.el6.x86_64.rpm
STEP-2: Stop Mysql Service for mysql 5.7
[root@ctpdb1 MY8.0]# service mysqld stop
mysqld is stopped
STEP-3: Go to mysql extracted folder and install rpm package using below command, if you are trying separate rpm installation then you will get package conflict error. check this post about RPM Package Fail due to conflicts with mysql package Solution
[root@ctpdb1 MY8.0]# yum install mysql-community-{server,client,common,libs-compat,libs}-* mysql-8.*.
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
======================
Updating:
mysql-community-client x86_64 8.0.21-1.el6 /mysql-community-client-8.0.21-1.el6.x86_64 228 M
mysql-community-common x86_64 8.0.21-1.el6 /mysql-community-common-8.0.21-1.el6.x86_64 8.8 M
mysql-community-libs x86_64 8.0.21-1.el6 /mysql-community-libs-8.0.21-1.el6.x86_64 22 M
mysql-community-libs-compat x86_64 8.0.21-1.el6 /mysql-community-libs-compat-8.0.21-1.el6.x86_64 5.7 M
mysql-community-server x86_64 8.0.21-1.el6 /mysql-community-server-8.0.21-1.el6.x86_64 2.3 G
Transaction Summary
========================
Upgrade 5 Package(s)
Total size: 2.5 G
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : mysql-community-common-8.0.21-1.el6.x86_64 1/10
Updating : mysql-community-libs-8.0.21-1.el6.x86_64 2/10
Updating : mysql-community-client-8.0.21-1.el6.x86_64 3/10
Updating : mysql-community-server-8.0.21-1.el6.x86_64 4/10
Updating : mysql-community-libs-compat-8.0.21-1.el6.x86_64 5/10
Cleanup : mysql-community-server-5.7.31-1.el6.x86_64 6/10
Cleanup : mysql-community-client-5.7.31-1.el6.x86_64 7/10
Cleanup : mysql-community-libs-compat-5.7.31-1.el6.x86_64 8/10
Cleanup : mysql-community-libs-5.7.31-1.el6.x86_64 9/10
Cleanup : mysql-community-common-5.7.31-1.el6.x86_64 10/10
Verifying : mysql-community-server-8.0.21-1.el6.x86_64 1/10
Verifying : mysql-community-client-8.0.21-1.el6.x86_64 2/10
Verifying : mysql-community-libs-compat-8.0.21-1.el6.x86_64 3/10
Verifying : mysql-community-libs-8.0.21-1.el6.x86_64 4/10
Verifying : mysql-community-common-8.0.21-1.el6.x86_64 5/10
Verifying : mysql-community-libs-5.7.31-1.el6.x86_64 6/10
Verifying : mysql-community-server-5.7.31-1.el6.x86_64 7/10
Verifying : mysql-community-client-5.7.31-1.el6.x86_64 8/10
Verifying : mysql-community-libs-compat-5.7.31-1.el6.x86_64 9/10
Verifying : mysql-community-common-5.7.31-1.el6.x86_64 10/10
Updated:
mysql-community-client.x86_64 0:8.0.21-1.el6mysql-community-common.x86_64 0:8.0.21-1.el6 mysql-community-libs.x86_64 0:8.0.21-1.el6
mysql-community-libs-compat.x86_64 0:8.0.21-1.el6 mysql-community-server.x86_64 0:8.0.21-1.el6
Complete!
STEP-4: Start Mysql 8.0
[root@ctpdb1 MY8.0]# service mysqld start
Starting mysqld: [ OK ]
Up-gradation complete now you can login with MySQL 8.0.
[root@ctpdb1 MY8.0]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.21 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>

 Please share your comment on below box.

Subscribe Us