How to store the data of mysql on OS X in an encrypted state?

3

1

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

GJ.

Posted 2011-01-04T01:26:54.107

Reputation: 8 151

1Do you start and stop MySQL yourself, or does it always run? – Daniel Beck – 2011-01-04T08:29:33.393

it always runs. – GJ. – 2011-01-04T13:23:13.047

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 – 2011-01-04T13:49:19.300

How does MySQL start? Does it use the org.macports.mysql5.plist provided by MacPorts? – kate – 2011-01-12T22:44:25.557

@Tait: yes. (launchd) – GJ. – 2011-01-14T21:45:40.027

Answers

3

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.

NReilingh

Posted 2011-01-04T01:26:54.107

Reputation: 5 539

1

The user didn't understand your second option, maybe you could elaborate what it means.

– Daniel Beck – 2011-01-04T11:20:46.147

1

If you just want fields encrypted you could do something like this: https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6124013.html

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

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

RobotHumans

Posted 2011-01-04T01:26:54.107

Reputation: 5 758

1

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. http://gazzang.com

Victor Scott

Posted 2011-01-04T01:26:54.107

Reputation: 11

well... it's OS X – GJ. – 2011-01-14T21:46:09.107