Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have mysql 5.1 installed by macports with it's data dir in the default location, which is outside my user directory that's protected by filevault.

I'd like to store the data in an encrypted state by either somehow moving it into the filevault or using some alternate encryption method.

Can you suggest a way to to do either one of these?

Many thanks

share|improve this question
Do you start and stop MySQL yourself, or does it always run? – Daniel Beck Jan 4 '11 at 8:29
it always runs. – GJ. Jan 4 '11 at 13:23
In that case, you lose. Think about it: Your system would need to access the MySQL data before you can even log in. Any encryption's pass phrase would have to be stored somewhere in startup scripts. – Daniel Beck Jan 4 '11 at 13:49
How does MySQL start? Does it use the org.macports.mysql5.plist provided by MacPorts? – kate Jan 12 '11 at 22:44
@Tait: yes. (launchd) – GJ. Jan 14 '11 at 21:45

If you'd like it to be used in the same manner as FileVault (unencrypted on login, encrypted automatically on logout), just move the data to somewhere in your user homedirectory, get your permissions set up right, and then symlink to the data from the default location.

If you just want to make an encrypted archive, you could do that with an encrypted DMG from Disk Utility.

share|improve this answer
The user didn't understand your second option, maybe you could elaborate what it means. – Daniel Beck Jan 4 '11 at 11:20

If you just want fields encrypted you could do something like this:

The article describes using the encode or encrypt method for field contents.

Truecrypt would let you move it into a encrypted virtual partition...

share|improve this answer

If your running Linux try ezNcrypt from Gazzang It's a complete transparent data encryption solution for MySQL with very low if any performance cost.

share|improve this answer
well... it's OS X – GJ. Jan 14 '11 at 21:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.