How to Downgrade MySQL 8.0 to MariaDB 10.3 (Fresh install)

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
I realize the Install failing isnt clean, its some module disable in some repo, just did this to have WHM handle this part, then I took over with the install once the disabling is done.
 

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
Hi @cPRex here is a cleaner version of this and much simpler

1. You start with yum remove mysql in Terminal, finish removing it
2. You move the current /var/lib/mysql to /var/lib/mysql.old or delete, but moving is always better
3. Edit the /var/cpanel/cpanel.config from mysql-version=8.0 to mysql-version=10.3
3. WHM > MySQL/MariaDB Upgrade > 10.3 > Unattended.

This will cause this

Code:
Obtained version information from cpanel.config.
Beginning “MariaDB 10.3” upgrade...
nsuring the “MariaDB103” repository is available and working.
Disabling package module mysql
Disabling package module mariadb
checkyum version 22.3 (excludes: bind-chroot)
.,.... more autoscroll items
Dependencies resolved.
Nothing to do.
Complete!
MariaDB installed from official repository.
Building configuration.


mysql restarted successfully.
MariaDB upgrade completed successfully
4. Lets reconnect Root password WHM > Mysql Root Password

Code:
Updated the password for the active MySQL profile.
Applications using MySQL will now be updated.
Updating “DBcache” configuration … Success …Done Updating “Roundcube” configuration … Roundcube is configured to use SQLite. This update is for Roundcube using MySQL. Running /usr/local/cpanel/bin/update-roundcube-sqlite-db. Success …Done Updating “phpMyAdmin” configuration … Success …Done
You have successfully changed “root”’s MySQL password.
Done!, I wish I could just delete my initial 2 replies and just SET this as the only thing in the reply, to avoid anyone the other hassle..

All done

Current Version
MariaDB 10.3.35-MariaDB

Tried, tested, works.. @cPRex Maybe you can edit my first 2 and just change text to "...." so people will see this post? or SPLIT my post into a new thread and delete the initial thread..
 

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
This was very helpful and should be in the official docs.

Other users please note - this should only be done on clean install, not where there are existing databases
Glad you found it helpful, It sure helped me to figure this out, I have used this now twice since then during a reload of a server after a team colleague forgot the initial settings before launching the installer. Glad it helps someone else :)
 

CanSpace

Well-Known Member
PartnerNOC
Nov 25, 2011
70
61
68
cPanel Access Level
DataCenter Provider
FYI this method still more or less works, but after you do a yum remove of mysql, and update the cpanel.config file, the MySQL/MariaDB Upgrade section in WHM no longer gives you the option to install MariaDB. The way around this is to perform that step using the API instead. ie from the command line run:

whmapi1 --output=jsonpretty start_background_mysql_upgrade version='10.3'
 

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
FYI this method still more or less works, but after you do a yum remove of mysql, and update the cpanel.config file, the MySQL/MariaDB Upgrade section in WHM no longer gives you the option to install MariaDB. The way around this is to perform that step using the API instead. ie from the command line run:

whmapi1 --output=jsonpretty start_background_mysql_upgrade version='10.3'
Great addition to this thread, I somehow didn't end up not being able to do it, maybe they added something later? At least at the time I used this I didn't have to do this but its good to have nontheles =)