Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

mysql 5.6 to mariadb 10.1.x centos 7.x datadir issue

Comments

6 comments

  • cPanelMichael
    Hello, Using a data directory within /home, /usr, /etc, /boot, or /root is unsupported because of changes in MariaDB that would lead to it failing to start (MariaDB uses a default systemd unit configuration that enables the "ProtectSystem" and "ProtectHome" features). Unfortunately, the only supported workaround in your case would be to setup a new server with an updated partition scheme with enough space for your databases in /var/lib/mysql and then migrate the accounts to it via "WHM >> Transfer Tool". Thank you.
    0
  • jsparks
    Hi Michael, If mysql datadir is set to /home/mysql, could I just bind this to a different path via mount --bind? Optionally, I've read that setting ProtectHome=false in /usr/lib/systemd/system/mariadb.service could do the trick. I've not tested either of these options in CPanel, but would you know if either of these methods would provide a stop-gap solution? Thanks
    0
  • cPanelMichael
    Hello, While unsupported, setting up a bind mount to point /var/lib/mysql/ to the desired /home/ directory should allow it to work until you've had a chance to increase the size of your /var/ partition or migrate to a server with a new partition scheme. Thank you.
    0
  • Kurieuo
    Hello, While unsupported, setting up a bind mount to point /var/lib/mysql/ to the desired /home/ directory should allow it to work until you've had a chance to increase the size of your /var/ partition or migrate to a server with a new partition scheme. Thank you.

    I've read its good to avoid bind mounting unless necessary since it can look like just a second copy. Is there any downside to this with cPanel detecting database sizes or the like? Is there any real disadvantage to bind mounting the mysql folder? I find myself in a similar situation where I need to move the var/lib/mysql folder (or maybe logs would be a better option for now) because I just overlooked the mysql folder in a rushed server move.
    0
  • Kurieuo
    Hi Michael, If mysql datadir is set to /home/mysql, could I just bind this to a different path via mount --bind? Optionally, I've read that setting ProtectHome=false in /usr/lib/systemd/system/mariadb.service could do the trick. I've not tested either of these options in CPanel, but would you know if either of these methods would provide a stop-gap solution? Thanks

    JS, how did your move go? Any issues noticed since?
    0
  • cPanelMichael
    Hello @Kurieuo, The downside is that we don't test cPanel & WHM on environments where the MySQL data directory is configured as a bind mount. While I've not seen reports of any problems with this setup, it's not something we routinely test against. I recommend against setting up the bind mount for this purpose if at all possible. It's only intended as a temporary workaround until you have an opportunity to add a new mount with additional space or migrate the accounts to a server with a new partition scheme. Thank you.
    0

Please sign in to leave a comment.