• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How To move data directory /var/lib/mysql

R

Rocket32

Guest
How do I move the mysql data directory to another the partition of the https directory or where the hosting allows me a large amount of space? My mysql data is large and causes problems. How do I move the data from /var/lib/mysql directory to another partition or create one? I am only allowed so much space in /var directory which is part of root partition. I have 400G of Disk Space and only 4 Gigs of Ram which is where the mysql data directory is located, taking up a large amount of that Ram space on each new mysql database install that has space. I would like to move the mysql data directory and/or whatever other files needed to be moved to the Server Disk Drive space I have on this account which is 400G.
 
Last edited by a moderator:
It is specified in /etc/my.cnf as

datadir=/var/lib/mysql
 
My question is can I change it in my.cnf without interfering or messing up the current local mysql databases. I am trying to put it on another partition which is not limited to space. Also, how do I put it on another partition where the sites are or the 400GB space on my server account? I just want to move it because the partition it is on only allows 4GB. My mysql databases require a lot of space which eats up this 4G on the same partition.
 
You can mount your another partition to /var/lib/mysql mount point at least. Look at common Linux mount documentation and /etc/fstab file.
 
Back
Top