Can I put a single MySQl database in a different directory from the others?
I have a bunch of databases in c:\xampp\mysql\data and am happy enough to protect them with standard MySql GRANT, or even no protection at all.
Now I intend to make a database which must remain private. I don't trust my mastery of MySql security and worry about possible reverse engin开发者_运维知识库eering, etc.
Can I put the database in a TrueCrypt volume and specify the path to it when connecting? The --database argument looks interesting, but I can't find enough information.
If I want to do it programatically, an I specify the path in the connect string?
I can't see any way to do this in the way you specify.
However it is possible to run more than one instance of MySQL on a single machine. Each server can (must) then have a seperate data directory.
http://dev.mysql.com/doc/refman/5.1/en/multiple-servers.html
As each server must communicate on a different port, you would select the required database by the port.
Unfortunately not.
When you start the MySQL Server, you can specify --datadir
, but this won't solve your requirements.
Curious why you don't trust MySQL's Permissions system though?
You can put the database on a TrueCrypt volume, but you can't specify the path as a parameter for a connection. The path is a configuration option either when setting up the server, or creating tables.
精彩评论