How to downgrade MySQL8 to MySQL5.7

tezilaw

New member
Joined
Jul 30, 2024
Messages
1
Directadmin has MySQL8 installed by default ,How to downgrade MySQL8 to MySQL5.7?

What should I do if my client needs to use MySQL 5.7? Thank you all.
 
Mysql 5.7 and 8.0 don't have any diferrence, only thing you do just set sql-mode
#/etc/my.cnf
Code:
[mysqld]
sql-mode=""
if still not enought and you really want to install mysql5.7, read below



No easy logics for downgrade version.
(Since custombuild already drop support mysql5.7, there have no ways to install mysql5.7)

1. backup everything with Admin Backup
2. use custombuild to change into mysql5.7 (MySQL 5.7 availability depends on the distro) (Deprecated)
3. remove/move "/var/lib/mysql" into other place. ( I suggest to move to other place until everything is working again before remove).
4. re-install mysql
5. re-install phpmyadmin, roundcube
6. restore backup
7. if everything comeback to work again do next step.
8. remove old mysql that's you just move or backup from #3 .
 
Last edited:
Mysql 5.7 and 8.0 don't have any diferrence, only thing you do just set sql-mode
Unless you need to do something like this:
Code:
SELECT Something, Tag
FROM
    (
        SELECT Something, Tag, 2*( ROW_NUMBER() OVER (ORDER BY Tag)) AS RowNum
          FROM Palsy WHERE Tag = 'H'
    UNION ALL
        SELECT Something, Tag, 1+2*(ROW_NUMBER() OVER (ORDER BY Tag)) AS RowNum
          FROM Palsy WHERE Tag = 'A') AS X
ORDER BY RowNum
5.7 does not like something in this.
 
Back
Top