Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Encrypt database in var/lib/mysql

Writer Mia Lopez

I have Database I want to Encrypt located in var/lib/mysql. Is it possible to Encrypt the whole mysql directory? How would I go about doing this

1

1 Answer

Is it possible to encrypt the whole mysql directory?

No. eCryptFS (that would be the tool to use) encrypted directories are only accessible by the users that mount them. MySQL doesn't run as your user and can use more than 1 user to do its tasks so that creates a problem.

Is it possible to encrypt mysql? . How would I go about doing this

Create a partition, encrypt it using LUKS and then use that to mount 1 of the parts of the directory /var/lib/mysql/. It should be considered an advanced user task so make sure to make backups and know how to undo whatever you do to set this up. explains how to use LUKS.

Mind that with an encrypted partition a reboot will never automatically start MySQL since you will need to manually unlock the partition when the system boots.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy