[Centos] Downgrade Mysql, got this : MySQL 5.7 cannot be directly upgraded to 5.5 If you wish to upgrade MySQL to 5.5, do it in increments ...

Horse

Verified User
Joined
Aug 23, 2020
Messages
8
Current mysql version is 5.7

To downgrade mysql, using this tutorial too? :

How to upgrade mysql with custombuild 2.0
https://help.directadmin.com/item.php?id=240

cd /usr/local/directadmin/custombuild
./build set mysql 5.5
./build set mysql_inst mysql
./build set mysql_backup yes
./build update
./build mysql

i tried it but got this result :
MySQL 5.7 cannot be directly upgraded to 5.5
If you wish to upgrade MySQL to 5.5, do it in increments, upgrading 5.7 to the next version released, and going up until you reach 5.5.

tried to 5.6 first, but same :
MySQL 5.7 cannot be directly upgraded to 5.6
If you wish to upgrade MySQL to 5.6, do it in increments, upgrading 5.7 to the next version released, and going up until you reach 5.6.




if not, which tutorial to downgrade mysql, for Centos?

I only founding these
How to downgrade/upgrade MySQL on FreeBSD https://help.directadmin.com/item.php?id=106
Debian: Downgrading from MySQL 5.6 to 5.5 https://help.directadmin.com/item.php?id=513
How to downgrade to MySQL 4.0 from 4.1 (Linux/rpms) https://help.directadmin.com/item.php?id=96
 
you can't safely downgrade, only reinstall.
1. Just make backups, (I'm using "admin backup/transfer" with selected database data/settings)
2. remove/rename old mysql directory (usually /var/lib/mysql)
3. then: https://help.directadmin.com/item.php?id=240
4. restore all backups from (1.) this will recreate all databases with all their configs.
also check mysql config (if you add there some specific strings incompatible with old mysql version)
 
you can't safely downgrade, only reinstall.
1. Just make backups, (I'm using "admin backup/transfer" with selected database data/settings)
2. remove/rename old mysql directory (usually /var/lib/mysql)
3. then: https://help.directadmin.com/item.php?id=240
4. restore all backups from (1.) this will recreate all databases with all their configs.
also check mysql config (if you add there some specific strings incompatible with old mysql version)


thanks for the reply, its not live vps, so its ok to removing the /var/lib/mysql directory
i already tried below, but got error below, & Mysql 5.5 installation looks like not successfully



[root@server custombuild]# rm -rf /var/lib/mysql

[root@server custombuild]# cd /usr/local/directadmin/custombuild
[root@server custombuild]# ./build set mysql 5.5
mysql is already set to 5.5
[root@server custombuild]# ./build set mysql_inst mysql
mysql_inst is already set to mysql
[root@server custombuild]# ./build set mysql_backup yes
mysql_backup is already set to yes
[root@server custombuild]# ./build update
--2020-08-29 20:24:47-- https://files-ca.directadmin.com/services/custombuild/2 .0/custombuild.tar.gz
Resolving files-ca.directadmin.com (files-ca.directadmin.com)... 2607:5300:60:1e b6::16, 51.161.40.239
Connecting to files-ca.directadmin.com (files-ca.directadmin.com)|2607:5300:60:1 eb6::16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 253843 (248K) [application/octet-stream]
Saving to: './custombuild.tar.gz'

100%[======================================>] 253,843 970KB/s in 0.3s

2020-08-29 20:24:48 (970 KB/s) - './custombuild.tar.gz' saved [253843/253843]

Extracting custombuild.tar.gz...
[root@server custombuild]# ./build mysql
Found /usr/local/directadmin/custombuild/mysql/MySQL-client-5.5.62-1.el7.x86_64. rpm
Found /usr/local/directadmin/custombuild/mysql/MySQL-devel-5.5.62-1.el7.x86_64.r pm
Found /usr/local/directadmin/custombuild/mysql/MySQL-server-5.5.62-1.el7.x86_64. rpm
Found /usr/local/directadmin/custombuild/mysql/MySQL-shared-5.5.62-1.el7.x86_64. rpm
Stopping mysqld ...
Updating MySQL 5.5.62 to 5.5.62
warning: MySQL-client-5.5.62-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.5.62-1.el7 ################################# [ 25%]

******************************************************************
A MySQL server package (cl-MySQL-meta-5.7.31-1.el7.cloudlinux.x86_64) is install ed.

Upgrading directly from MySQL 5.7 to MySQL 5.5 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MySQL manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'

You may choose to use 'rpm --nodeps -ev <package-name>' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MySQL-shared-compat package.
- Install the new MySQL packages supplied by Oracle and/or its affiliates
- Ensure that the MySQL server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process. Important details
can be found in the MySQL manual, in the Upgrading section.
******************************************************************
error: %pre(MySQL-server-5.5.62-1.el7.x86_64) scriptlet failed, exit status 1
error: MySQL-server-5.5.62-1.el7.x86_64: install failed
2:MySQL-devel-5.5.62-1.el7 ################################# [ 50%]
3:MySQL-client-5.5.62-1.el7 ################################# [ 75%]
Ensuring local-infile is disabled for security reasons in MySQL configuration fi le...
/var/lib/mysql/mysql does not exist, running clean mysql data installation...
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql .sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex ists!
Error setting root pass using /usr/bin/mysqladmin. Trying SET PASSWORD.
Setting password: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('JUSTEXAMPLE Ly');
*********************************

We seem to have an error when trying to SET PASSWORD FOR 'root'@'localhost'

*********************************






already tried below, from similar thread https://forum.directadmin.com/threa...fails-and-im-getting-error-message-now.50131/
but still same

The following fixed the issue:
Code:
rm -f /var/lib/mysql/RPM_UPGRADE_MARKER
./build mysql





If i build mysql 5.7 again, its working without error
cd /usr/local/directadmin/custombuild
./build set mysql 5.7
./build set mysql_inst mysql
./build set mysql_backup yes
./build update
./build mysql



but what i need is mysql 5.5
how is it guys?
 
Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
---
also try to kill mysqld processes
 
Back
Top