Downgrade from MySql 5.7 to MySql 5.6 Centos 7

webos

Member
Nov 12, 2017
5
1
1
Greece
cPanel Access Level
Root Administrator
You must first take backup all your databases. In my case it was a fresh vps install and i needed 5.6 to make the vTiger 6.4.0 work (It was transfer from other server).

1.) Through SSH
Code:
mkdir -p /root/cpanel_profile/
then
Code:
vi /root/cpanel_profile/cpanel.config
and put a line
Code:
mysql-version=5.6
save and quit :wq

2.) Through SSH
Code:
sudo yum-config-manager --disable mysql57-community
sudo yum-config-manager --enable mysql56-community
You must enable and disable the version of MySQL
See what rpm do you have installed and erase them (or else they will confict the installation)
Code:
rpm -qa|grep mysql
Example
Code:
sudo yum erase package mysql-community-common-5.7.25-1.el7.x86_64
3.) Through WHM
Upgrade to Latest Version/Force a reinstall even if the system is up to date.

4.) Through SSH
Remove them and reinstall them beacause is not the latest 5.6.43 (in my case WHM installed the 5.6.41)
Code:
yum remove mysql mysql-server
mv /var/lib/mysql /var/lib/mysql_old_backup
yum install mysql mysql-server
5.) Through WHM
Home »SQL Services »MySQL Root Password »Add new password
Home »Account Functions »Password Modification »Add new password to the cPanel Account

6.) Through SSH
Code:
service cpanel restart
service mysql restart
 
Last edited by a moderator:
  • Like
Reactions: ChrisTNM

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @webos,

Keep in mind that while this manual workaround to downgrade to MySQL 5.6 may work, MySQL downgrades are unuspported. Was there anything in-particular that lead to the need to downgrade to MySQL version 5.6 on the affected system?

Thank you.
 

pebkac

Registered
Aug 29, 2005
3
0
151
There's a typo, in step 2 the 2nd command should be: sudo yum-config-manager --enable mysql56-community
 
Last edited by a moderator:

ChrisTNM

Member
Sep 24, 2013
15
0
1
cPanel Access Level
Root Administrator
Thanks for this, your exact steps didn't work for me but it was enough to get it working on my end. Around Step 3, I wasn't able to use WHM yet. I had to install the 5.6 mysql-server first for it to show up, after that I was able to go through WHM.