Please note that this workaround is intended for the Server Administrator. cPanel Support cannot perform these steps on your behalf, and cannot assist with any issues encountered in this process. Do ensure that you have working MySQL backups prior to attempting this workaround. Please reference our document on creating MySQL backups if needed.
Introduction
The following instructions are not supported though if you find that you are in a situation where your MariaDB data directory is outside of /var/lib/mysql, and you are unable to upgrade the service, then you can follow this information to get around the issue.
Procedure
Please follow these commands in sequence to create the bind-mount in question:
1) Add a line like the following to the bottom of /etc/fstab:
/home/var_mysql/mysql /var/lib/mysql none bind
2)
whmapi1 configureservice service=mysql enabled=0 monitored=0
This prevents the WHM Service Manager from unexpectedly restarting the service while you are working on it
3)
/scripts/restartsrv_mysql --stop
Stop the MySQL service to avoid issues when making changes to the mount.
4)
\rm -vi /var/lib/mysql
The above will remove the existing symbolic link for the MySQL directory.
5)
mkdir /var/lib/mysql && chown mysql:mysql /var/lib/mysql && chmod 751 /var/lib/mysql
Here, we are creating the directory for the mount.
6)
mount /var/lib/mysql
This command wll perform the bind-mount based on the existing fstab entry that was created in the beginning.
7) Remove data directory configuration /etc/my.cnf if it is set.
8)
whmapi1 configureservice service=mysql enabled=0 monitored=0
Here, we reenable MySQL on the server.
9)
/scripts/restartsrv_mysql
Lastly, we restart the MySQL service such that the changes that were made previously are taken.