Remounting MySQL under a new mount point
/var/lib/mysql is mounted on partition / which is now full. Is there a way to mount this under /home/mysql for more disk space?
Solution 1:
- Stop MySQL
- Move MySQL data from
/var/lib/mysql
to/home/mysql
- Point MySQL to the new data directory
- Start MySQL
It could be implemented like this (WARNING: not tested)
/etc/init.d/mysql stop
mv /var/lib/mysql /home/.
ln -s /home/mysql /var/lib/mysql
/etc/init.d/mysql start
Always have a backup before you start moving the data directory.