1. Make a full mysqldump file
# mysqldump --opt -uroot -proot_password > /tmp/mysqldump
2. Disable MySQL monitoring
whmapi1 configureservice service=mysql enabled=1 monitored=0
3. Stop MySQL
# systemctl stop mysql
4. Ensure that the following settings are present
check file /etc/systemd/system/mariadb.service.d/homedir.conf
[Service]
ProtectHome=false
ProtectSystem=off
5. Make the directory for MySQL in /home, move it.
# mkdir /home/var_mysql
# mv /var/lib/mysql /home/var_mysql
# chown -R mysql:mysql /home/var_mysql/mysql
6. Create an empty /var/lib/mysql directory where the socket file will be located.
# mkdir /var/lib/mysql/
# chown mysql:mysql /var/lib/mysql/
7. Edit /etc/my.cnf file to contain these directives:
socket=/var/lib/mysql/mysql.sock
datadir=/home/var_mysql/mysql
6. Remount CageFS system-wide:
# cagefsctl --remount-all
7. Start MySQL:
# systemctl start mysql
8. Enable MySQL monitoring
whmapi1 configureservice service=mysql enabled=1 monitored=1
Comments
0 comments
Please sign in to leave a comment.