G
G
Guardy2017-12-14 12:24:14
linux
Guardy, 2017-12-14 12:24:14

How to move mysql data folder to removable hhd drive?

There is Linux Mint 17.3
data is now stored in /var/lib/mysql how
to transfer it to /media/user/HDD/mysql for example ssd on 120gb number for the system and mysql with data takes 30gb and all this will grow

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2017-12-14
@martin74ua

And who's stopping you from mounting an external drive in /var/lib/mysql ?

W
Wexter, 2017-12-14
@Wexter

Mount the disk, copy files from /var/lib/mysql. Then in the file /etc/mysql/mysql.conf.d/mysqld.cnf change the path /var/lib/mysql to a new path to the folder, then in the file /etc/apparmor.d/usr.sbin.mysqld lines

# Allow data dir access
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
change to a new path, restart apparmor and start the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question