Mysql to mariadb upgrade failed. please help!

Oh, you are referencing to /var/lib/mysql because... you are not my OS, so we speak different languages :)

I think you should return your backup of /var/lib/mysql, then set mysql 5.7 in options.conf and rebuild. There is no reason for trying to go back to 5.5.
 
You mean /var/lib/mysql because there is no /home/mysql on my OS I'm on Centos 6.x.

I already deleted that. On my new server I can easily install a fresh mysql 5.5 again. But this will not happen on the old server.

On the old server I got this message every time:
MySQL 10.0 cannot be directly upgraded to 5.5
If you wish to upgrade MySQL to 5.5, do it in increments, upgrading 10.0 to the next version released, and going up until you reach 5.5.
And options.conf is set to mysql, is set to 5.5 and /var/lib/mysql is removed. Still it keeps giving this notice.
 
Here is what the build script is doing:

Code:
        if [ "${MYSQL_INST_OPT}" = "mysql" ] && [B][ -e ${MYSQL_BIN} ][/B]; then
                MYSQL_MAIN="`mysql_main`"
                if [ "${MYSQL_MAIN}" != "${MYSQL_OPT}" ]; then
                        if ! echo ${MYSQL_SET} | grep -m1 -q "${MYSQL_MAIN} ${MYSQL_OPT}"; then
                                echo "MySQL ${MYSQL_MAIN} cannot be directly upgraded to ${MYSQL_OPT}"
                                do_exit 1 "If you wish to upgrade MySQL to ${MYSQL_OPT}, do it in increments, upgrading ${MYSQL_MAIN} to the next version released, and going up until you reach ${MYSQL_OPT}."
                        fi
                fi
        fi

I translate this to myself as the following: if you try to install "mysql" and the binary MYSQL_BIN exists, then check if the versions are compatible for upgrade, then if not - fail with the mentioned error message.

Yours fail because it looks like you have MariaDB 10.0 binary - just a guess.

Upper in the code I see:

Code:
if [ "${OS}" = "FreeBSD" ]; then
        if [ ! -d /var/lib/mysql/mysql ]; then
                MYSQL_DATA=/home/mysql
        fi
        MYSQL_BIN=/usr/local/mysql/bin/mysql
else
        if [ -e /etc/debian_version ]; then
                if [ ! -d /var/lib/mysql/mysql ]; then
                        MYSQL_DATA=/home/mysql
                fi
                MYSQL_BIN=/usr/local/mysql/bin/mysql
        else
                [B]MYSQL_BIN=/usr/bin/mysql[/B]
        fi
fi

So I guess you need to delete the binary /usr/bin/mysql - this will make the whole check in the first quoted code block to return negative result and the compilation will continue. And you can set whatever version you want - MariaDB/MySQL, etc, does not matter.

With no datadir and no binary, it will do a fresh install.

I guess you can put back your datadir, set 5.7 in the options.conf, delete the binary and install it. If I am not missing something from the code, it should work.
 
Last edited:
When you were writing (thank you for the help too) I managed to install MariaDB 10.0 again with errors. Then I used the help file to reset it and a working MariaDB was present again.
https://help.directadmin.com/item.php?id=563

However, it choose Mariadb again, there is no way to choose (which would have been better).

After that I used the special scripts to restore backups from mysql which DA made:
https://help.directadmin.com/item.php?id=678

They got all restored, but all now give a database connection error.

I also tried what you said, but it keep saying the error notice about mysql 10.0 not being able to upgrade to 5.5.
As long as that version 10 is showing (don't know where it gets it from) there is no way to reinstall mysql 5.5.

Going to sleep now. It's 05.00 am here.

@DanielP and @Wattie, thank you both for all your help!!
 
Why Maria 10.0 when I told you that MySQL 5.7 is not compatible with it? You had to try 10.2!

On the second thing I don't know what I might be missing, but:

Code:
mv /usr/bin/mysql /usr/bin/mysql.bak
mv /var/lib/mysql /var/lib/mysql.bak
/usr/local/directadmin/custombuild/build mysql

should work and should create a clean installation of whatever MySQL/MariaDB version is listed in options.conf. Should be errorless.
 
Last edited:
Yes correct, that should work, but it doesn't. And I don't know why.
I did not backup these files but deleted them all.

So I installed mysql, which caused again several failed statements, so no good clean installation again.:(
Then again reset via the help file, which looks as if it's again installing Mariadb.

Code:
/etc/init.d/mysqld status
MariaDB running (8518)                                     [  OK  ]
while Mysql was installed by custombuild.

I give up and go to sleep. Somewhere something is wrong here. On the Centos 7 server I had almost no issue going backup from Mariadb 10.0 to Mysql 5.7.
This Centos 6 server is giving me a headache.

Thanks though.
 
Smtalk fixed things for me via priority support, first going back to mysql 5.7 doing also dump restore and then upgrade to mariadb 10.2. He even tuned it.
His priority support is great! Thank you very much for your great help Martynas!
 
Back
Top