MySQL will have more luck in upgrading to newer versions rather than downgrading, as older versions don't always support the newer file formats. As such, tasks such as downgrading from 5.6 to 5.5 can be a tricky task.
The main purposes for this guide is for Users of Debian 7, which don't want to use MySQL 5.6. In this example, we'll downgrade to 5.5.35, but you can adjust the versions as needed.
This guide is for fresh installs, where no data has been added yet.
If you have already added data to the database, you must make backups of your databases, and restore them when the downgrade is finished.
Using the tool:
User Level -> Create/Restore Backups
will be easiest, as it would also restore the user/passwords and even let you only select the 2 database options for backup/restore, so other User data is less affected. Raw mysqldumps/restores of the mysql.* databases won't work as well, because of the different formats.
This tasks isn't as suited to CustomBuild because this will be doing a wipe, and fresh install of the 5.5 version (sets up root and da_admin accounts), which CB does not do.
We'll need to download the 5.5 version:
Then we need to tell DA about the file, so it can find it for the install. Edit:
Find the mysql_standard line, and set it to the new file:
Stop the old mysql and cleanup the leftovers.
- In DA, go to Admin Level -> Services Monitor -> mysqld: stop
- move the old data out of the way and ensure it's ready for re-install:
rm -f /usr/local/mysql
mv /home/mysql /home/mysql.old
rm -f /tmp/mysql.sock
Next, install it. When asked to delete the old /home/mysql directory, you must answer "y" so we don't use the unsupported newer files.
You can specify any passwords
you'd like, replace the bold
values that you want to use:
./mysql.sh rootpass da_admin daadminpass
After any changes to MySQL versions, it's recommended to recompile php:
./build php n
For future MySQL updates, you can use CustomBuild. Just make sure that the mysql= value in the options.conf is set to 5.5, to keep the same version family.
If you need to create a new tar.gz for MySQL, you can use the new force_mysql_compile option:
./build set mysql_force_compile yes
again, making sure the mysql= version in the options.conf is set as desired. This should update to the latest version with a forced compile (instead of binary download, which doesn't always match up).
It should save the tar.gz to /usr/local, in case you need to use it for step #1 above.
It may also be stored in the /usr/local/directadmin/custombuild/mysql-5.5.35/mysql-5.5.35-linux2.6-x86_64.tar.gz path.