MySQL Downgrade

From GoBlueMich Wiki
Jump to navigation Jump to search


WORK IN PROGRESS loose notes from memory, proceed at own risk, update/edit as appropriate

cpanel is assumed, non-cpanel process mostly the same, but replacement mysql install will be through package manager

MySQL downgrade is essentially MySQL removal, and re-installation.


  1. determine datadir
mysql -e \"show variables;\"|grep datadir

  1. pasteables will assume default datadir
du -hs /var/lib/mysql
  1. also do the LW pre-EA pasteable from the wiki there
df -H
  1. is there enough space to hold 3-4x the datadir size?


mkdir -p /home/temp/mysqlpredowngrade
cd /home/temp/mysqlpredowngrade
echo \"SHOW DATABASES;\" | mysql -Bs|while read i ; do echo Dumping $i ; mysqldump --single-transaction $i > $i.sql ; done
tail -n 1 ./*.sql

The tail command should output \"Dump completed\" and timestamp for EVERY FILE.

If it doesn't, go back and resolve that issue.

Erase /home/temp/mysqlpredowngrade/*.sql and re-do dumps until all are complete.

Remove Old (mariaDB):

/usr/local/cpanel/libexec/tailwatchd --stop
service mysql stop
cd /etc/yum.repos.d/
sed -i \'s/enabled=1/enabled=0/g\' MariaDB*.repo yum remove MariaDB-server MariaDB-client MariaDB-devel MariaDB-common MariaDB-compat cd /var/lib mv mysql mysql.predowngrade mkdir mysql chown mysql. mysql

Install New (cPanel-specific):

nano /var/cpanel/cpanel.config

  1. change mysql-version to desired version

Restore Data:

Restore Users

Restore Grants